C# (WinRT): テキストを画面に表示

TextBlockPage

xaml: TextBlockPage.xaml

<Page
    x:Class="Snippets.TextBlockPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Snippets"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid x:Name="grid" Background="{StaticResource ApplicationPageBackgroundThemeBrush}">

    </Grid>
</Page>

cs: TextBlockPage.xaml.cs

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace Snippets
{
    public sealed partial class TextBlockPage : Page
    {
        public TextBlockPage()
        {
            this.InitializeComponent();
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            StackPanel stack = new StackPanel();
            this.grid.Children.Add(stack);
            
            TextBlock textBlock = new TextBlock();
            textBlock.Text = "hogehoge";
            textBlock.Width = 200;
            textBlock.Height = 100;
            stack.Children.Add(textBlock);

            SolidColorBrush backgroundColor = new SolidColorBrush();
            backgroundColor.Color = Windows.UI.Color.FromArgb(0xFF, 0xFF, 0x00, 0x00);
            StackPanel stack2 = new StackPanel();
            stack2.Background = backgroundColor;
            stack.Children.Add(stack2);

            SolidColorBrush color = new SolidColorBrush();
            color.Color = Windows.UI.Color.FromArgb(0xFF, 0xFF, 0xE8, 0x00);
            TextBlock textBlock2 = new TextBlock();
            textBlock2.FontFamily = new FontFamily("Consolas");
            textBlock2.FontSize = 32;
            textBlock2.Height = 100;
            textBlock2.Text = "hogehoge";
            textBlock2.TextAlignment = TextAlignment.Right;
            textBlock2.Foreground = color;
            stack2.Children.Add(textBlock2);
            
        }
    }
}