<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls">

    <Style x:Key="HeaderedTextBlockTextStyle"
           TargetType="TextBlock">
        <Setter Property="Foreground" Value="{ThemeResource ApplicationForegroundThemeBrush}" />
        <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
        <Setter Property="SelectionHighlightColor" Value="{ThemeResource TextSelectionHighlightColorThemeBrush}" />
        <Setter Property="TextTrimming" Value="CharacterEllipsis" />
        <Setter Property="TextWrapping" Value="Wrap" />
        <Setter Property="TextLineBounds" Value="TrimToBaseline" />
        <Setter Property="OpticalMarginAlignment" Value="TrimSideBearings" />
        <Setter Property="FontSize" Value="18" />
        <Setter Property="FontWeight" Value="Light" />
        <Setter Property="LineHeight" Value="28" />
    </Style>

    <Style TargetType="controls:HeaderedTextBlock">
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="Orientation" Value="Vertical" />
        <Setter Property="TextStyle" Value="{ThemeResource HeaderedTextBlockTextStyle}" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:HeaderedTextBlock">
                    <StackPanel x:Name="Panel"
                                Orientation="{TemplateBinding Orientation}">
                        <ContentPresenter x:Name="HeaderContentPresenter"
                                          Grid.ColumnSpan="4"
                                          x:DeferLoadStrategy="Lazy"
                                          AutomationProperties.AccessibilityView="Raw"
                                          AutomationProperties.Name="Header content"
                                          Content="{TemplateBinding Header}"
                                          ContentTemplate="{TemplateBinding HeaderTemplate}"
                                          Foreground="{ThemeResource SystemControlForegroundBaseHighBrush}"
                                          IsHitTestVisible="False"
                                          Visibility="Collapsed" />

                        <TextBlock x:Name="TextContent"
                                   AutomationProperties.Name="Text content"
                                   Style="{TemplateBinding TextStyle}"
                                   Text="{TemplateBinding Text}" />
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="OrientationStates">
                                <VisualState x:Name="Vertical" />
                                <VisualState x:Name="Horizontal">
                                    <VisualState.Setters>
                                        <Setter Target="TextContent.Margin" Value="10,0,0,0" />
                                    </VisualState.Setters>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
