<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">

    <ResourceDictionary.ThemeDictionaries>
        <ResourceDictionary x:Key="Default"/>
        <ResourceDictionary x:Key="Light">
            <SolidColorBrush x:Key="MarkdownBorderBrush" Color="#FFBEBEBE" />
            <SolidColorBrush x:Key="MarkdownBackgroundBrush" Color="#FFE0E0E0" />
        </ResourceDictionary>
        <ResourceDictionary x:Key="Dark">
            <SolidColorBrush x:Key="MarkdownBorderBrush" Color="#FF424242" />
            <SolidColorBrush x:Key="MarkdownBackgroundBrush" Color="#FF202020" />
        </ResourceDictionary>
    </ResourceDictionary.ThemeDictionaries>
    
    <Style TargetType="controls:MarkdownTextBlock">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="LinkForeground" Value="{ThemeResource SystemControlHighlightAccentBrush}" />
        <Setter Property="QuoteBackground" Value="{ThemeResource MarkdownBackgroundBrush}" />
        <Setter Property="QuoteBorderBrush" Value="{ThemeResource MarkdownBorderBrush}" />
        <Setter Property="QuoteBorderThickness" Value="2, 0, 0, 0" />
        <Setter Property="QuoteMargin" Value="7, 5, 0, 5" />
        <Setter Property="QuotePadding" Value="7, 2, 0, 4" />
        <Setter Property="CodeBackground" Value="{ThemeResource MarkdownBackgroundBrush}" />
        <Setter Property="CodeBorderBrush" Value="{ThemeResource MarkdownBorderBrush}" />
        <Setter Property="CodeBorderThickness" Value="2" />
        <Setter Property="CodeFontFamily" Value="Consolas" />
        <Setter Property="CodeMargin" Value="0, 7, 0, 7" />
        <Setter Property="CodePadding" Value="10, 6, 10, 6" />
        <Setter Property="EmojiFontFamily" Value="Segoe UI Emoji" />
        <Setter Property="Header1FontWeight" Value="Bold" />
        <Setter Property="Header1FontSize" Value="20" />
        <Setter Property="Header1Margin" Value="0, 15, 0, 15" />
        <Setter Property="Header1Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
        <Setter Property="Header2FontWeight" Value="Normal" />
        <Setter Property="Header2FontSize" Value="20" />
        <Setter Property="Header2Margin" Value="0, 15, 0, 15" />
        <Setter Property="Header2Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
        <Setter Property="Header3FontWeight" Value="Bold" />
        <Setter Property="Header3FontSize" Value="17" />
        <Setter Property="Header3Margin" Value="0, 10, 0, 10" />
        <Setter Property="Header3Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
        <Setter Property="Header4FontWeight" Value="Normal" />
        <Setter Property="Header4FontSize" Value="17" />
        <Setter Property="Header4Margin" Value="0, 10, 0, 10" />
        <Setter Property="Header4Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
        <Setter Property="Header5FontWeight" Value="Bold" />
        <Setter Property="Header5FontSize" Value="15" />
        <Setter Property="Header5Margin" Value="0, 10, 0, 5" />
        <Setter Property="Header5Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
        <Setter Property="Header6FontWeight" Value="Normal" />
        <Setter Property="Header6FontSize" Value="15" />
        <Setter Property="Header6Margin" Value="0, 10, 0, 0" />
        <Setter Property="Header6Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
        <Setter Property="HorizontalRuleBrush" Value="{ThemeResource MarkdownBorderBrush}" />
        <Setter Property="HorizontalRuleMargin" Value="0, 7, 0, 7" />
        <Setter Property="HorizontalRuleThickness" Value="2" />
        <Setter Property="ListMargin" Value="0, 5, 0, 5" />
        <Setter Property="ListGutterWidth" Value="32" />
        <Setter Property="ListBulletSpacing" Value="8" />
        <Setter Property="ParagraphMargin" Value="0, 5, 0, 5" />
        <Setter Property="TableBorderBrush" Value="{ThemeResource MarkdownBorderBrush}" />
        <Setter Property="TableBorderThickness" Value="1" />
        <Setter Property="TableCellPadding" Value="9, 4, 9, 4" />
        <Setter Property="TableMargin" Value="0, 5, 0, 5" />
        <Setter Property="TextWrapping" Value="Wrap" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:MarkdownTextBlock">
                    <Border x:Name="RootElement"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
