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

    <!--Base style for title bar buttons-->
    <Style x:Key="CaptionButtonStyle" TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid x:Name="LayoutRoot" Background="Transparent" Width="44" Height="35">
                        <TextBlock x:Name="txt" Text="{TemplateBinding Content}" FontFamily="{DynamicResource NativeIconFont}"
                                   FontSize="10"
                                   Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"
                                   RenderOptions.ClearTypeHint="Auto" TextOptions.TextRenderingMode="Aliased"
                                   TextOptions.TextFormattingMode="Display" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="LayoutRoot" Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="White" Opacity="0.1" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="MinimizeButtonStyle" TargetType="Button" BasedOn="{StaticResource CaptionButtonStyle}">
        <Setter Property="Content" Value="&#xE949;" />
        <Setter Property="Margin" Value="0,1,0,0" />
    </Style>

    <Style x:Key="MaximizeButtonStyle" TargetType="Button" BasedOn="{StaticResource CaptionButtonStyle}">
        <Setter Property="Content" Value="&#xE739;" />
    </Style>

    <Style x:Key="RestoreButtonStyle" TargetType="Button" BasedOn="{StaticResource CaptionButtonStyle}">
        <Setter Property="Content" Value="&#xE923;" />
    </Style>

    <Style x:Key="CloseButtonStyle" TargetType="Button">
        <Setter Property="Content" Value="&#xE106;" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid x:Name="LayoutRoot" Background="Transparent" Width="44" Height="35">
                        <TextBlock x:Name="txt" Text="{TemplateBinding Content}" FontFamily="Segoe MDL2 Assets"
                                   Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"
                                   RenderOptions.ClearTypeHint="Auto" TextOptions.TextRenderingMode="Aliased"
                                   TextOptions.TextFormattingMode="Display" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="LayoutRoot" Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="#CD1A2B"/>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="CaptionToggleButton" TargetType="ToggleButton">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid x:Name="LayoutRoot" Background="Transparent" Width="44" Height="35">
                        <TextBlock x:Name="txt" Text="{TemplateBinding Content}" FontFamily="Segoe MDL2 Assets"
                                   FontSize="10"
                                   Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"
                                   RenderOptions.ClearTypeHint="Auto" TextOptions.TextRenderingMode="Aliased"
                                   TextOptions.TextFormattingMode="Display" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="LayoutRoot" Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="White" Opacity="0.1" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter TargetName="LayoutRoot" Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="White" Opacity=".3"/>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="PinToggleStyle" TargetType="ToggleButton" BasedOn="{StaticResource CaptionToggleButton}">
        <Setter Property="Content" Value="&#xE840;"/>
    </Style>
</ResourceDictionary>