UWP - Segoe MDL2 Assets programmatically

MainPage.xaml

<Page
    x:Class="UniversalAppTutorials.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:UniversalAppTutorials"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    >
    <StackPanel Orientation="Vertical" Background="AliceBlue" Padding="50">
        <TextBlock 
            x:Name="TextBlock1"
            />
        <TextBlock 
            x:Name="TextBlock2"
            />
        <TextBlock
            x:Name="TextBlock3"
            />
    </StackPanel>
</Page>
MainPage.xaml.cs

using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Automation;
using Windows.UI;

namespace UniversalAppTutorials
{
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();

            // Set the first text block font family
            TextBlock1.FontFamily = new FontFamily("Segoe MDL2 Assets");

            // Set the first text block text
            TextBlock1.Text = "\uE717";

            // Set the automation properties name for first text block
            TextBlock1.SetValue(AutomationProperties.NameProperty, "Phone");

            // Set the first text block margin
            TextBlock1.Margin = new Thickness(25);

            // Second text block settings
            TextBlock2.FontFamily = new FontFamily("Segoe MDL2 Assets");
            TextBlock2.Text = "\uE909";
            TextBlock2.SetValue(AutomationProperties.NameProperty, "World");
            TextBlock2.Margin = new Thickness(25);
            // Font size
            TextBlock2.FontSize = 100;

            // Third text block settings
            TextBlock3.FontFamily = new FontFamily("Segoe MDL2 Assets");
            TextBlock3.Text = "\uE899";
            TextBlock3.SetValue(AutomationProperties.NameProperty, "Emoji");
            TextBlock3.Margin = new Thickness(25);
            // Font size
            TextBlock3.FontSize = 150;
            // Set text/icon color
            TextBlock3.Foreground = new SolidColorBrush(Colors.Blue);
        }
    }
}
More uwp tutorials