Back to Uno

Include Mainpage Csharp

doc/articles/getting-started/counterapp/includes/include-mainpage-csharp.md

6.6-release-branch-cut688 B
Original Source

The layout for the MainPage is defined in the MainPage.cs file. This file contains the C# Markup that defines the layout of the application.

csharp

public sealed partial class MainPage : Page
{
    public MainPage()
    {
        this.Background(ThemeResource.Get<Brush>("ApplicationPageBackgroundThemeBrush"))
            .Content(
                new StackPanel()
                    .VerticalAlignment(VerticalAlignment.Center)
                    .HorizontalAlignment(HorizontalAlignment.Center)
                    .Children(
                        new TextBlock()
                            .Text("Hello Uno Platform!")
                    )
            );
    }
}