<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:FooEditEngine.Metro">

    <ControlTemplate x:Key="FooTextBoxTemplate" TargetType="local:FooTextBox">
        <Border x:Name="BorderElement"
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}">
            <Grid x:Name="PART_Grid">
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <ScrollBar x:Name="PART_VerticalScrollBar"
                            Orientation="Vertical"
                            Grid.Row="0"
                            Grid.Column="1"
                            IndicatorMode="MouseIndicator"
                            Visibility="Visible"/>
                <ScrollBar x:Name="PART_HorizontalScrollBar"
                            Orientation="Horizontal"
                            Grid.Row="1"
                            Grid.Column="0"
                            IndicatorMode="MouseIndicator"
                            Visibility="Visible"/>
            </Grid>
        </Border>
    </ControlTemplate>

    <ResourceDictionary.ThemeDictionaries>
        <ResourceDictionary x:Key="Default">
            <Style TargetType="local:FooTextBox">
                <Setter Property="MinWidth" Value="{StaticResource TextControlThemeMinWidth}"/>
                <Setter Property="MinHeight" Value="{StaticResource TextControlThemeMinHeight}"/>
                <Setter Property="Foreground" Value="{StaticResource TextBoxForegroundThemeBrush}"/>
                <Setter Property="InsertCaret" Value="{StaticResource TextBoxForegroundThemeBrush}"/>
                <Setter Property="OverwriteCaret" Value="{StaticResource TextBoxForegroundThemeBrush}"/>
                <Setter Property="Background" Value="{StaticResource TextBoxBackgroundThemeBrush}"/>
                <Setter Property="LineMarker" Value="LightGray"/>
                <Setter Property="Template" Value="{StaticResource FooTextBoxTemplate}"/>
            </Style>
        </ResourceDictionary>
        <ResourceDictionary x:Key="HighContrastBlack">
            <Style TargetType="local:FooTextBox">
                <Setter Property="MinWidth" Value="{StaticResource TextControlThemeMinWidth}"/>
                <Setter Property="MinHeight" Value="{StaticResource TextControlThemeMinHeight}"/>
                <Setter Property="Foreground" Value="{StaticResource TextBoxForegroundThemeBrush}"/>
                <Setter Property="InsertCaret" Value="{StaticResource TextBoxForegroundThemeBrush}"/>
                <Setter Property="OverwriteCaret" Value="{StaticResource TextBoxForegroundThemeBrush}"/>
                <Setter Property="Background" Value="{StaticResource TextBoxBackgroundThemeBrush}"/>
                <Setter Property="LineMarker" Value="Gray"/>
                <Setter Property="Template" Value="{StaticResource FooTextBoxTemplate}"/>
            </Style>
        </ResourceDictionary>
        <ResourceDictionary x:Key="HighContrastWhite">
            <Style TargetType="local:FooTextBox">
                <Setter Property="MinWidth" Value="{StaticResource TextControlThemeMinWidth}"/>
                <Setter Property="MinHeight" Value="{StaticResource TextControlThemeMinHeight}"/>
                <Setter Property="Foreground" Value="{StaticResource TextBoxForegroundThemeBrush}"/>
                <Setter Property="InsertCaret" Value="{StaticResource TextBoxForegroundThemeBrush}"/>
                <Setter Property="OverwriteCaret" Value="{StaticResource TextBoxForegroundThemeBrush}"/>
                <Setter Property="Background" Value="{StaticResource TextBoxBackgroundThemeBrush}"/>
                <Setter Property="LineMarker" Value="LightGray"/>
                <Setter Property="Template" Value="{StaticResource FooTextBoxTemplate}"/>
            </Style>
        </ResourceDictionary>
        <ResourceDictionary x:Key="HighContrastCustom">
            <Style TargetType="local:FooTextBox">
                <Setter Property="MinWidth" Value="{StaticResource TextControlThemeMinWidth}"/>
                <Setter Property="MinHeight" Value="{StaticResource TextControlThemeMinHeight}"/>
                <Setter Property="Foreground" Value="{StaticResource TextBoxForegroundThemeBrush}"/>
                <Setter Property="InsertCaret" Value="{StaticResource TextBoxForegroundThemeBrush}"/>
                <Setter Property="OverwriteCaret" Value="{StaticResource TextBoxForegroundThemeBrush}"/>
                <Setter Property="Background" Value="{StaticResource TextBoxBackgroundThemeBrush}"/>
                <Setter Property="LineMarker" Value="DarkGray"/>
                <Setter Property="Template" Value="{StaticResource FooTextBoxTemplate}"/>
            </Style>
        </ResourceDictionary>
    </ResourceDictionary.ThemeDictionaries>

</ResourceDictionary>
