<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:local="clr-namespace:ModernWpf.Controls"
    xmlns:primitives="clr-namespace:ModernWpf.Controls.Primitives">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Button.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <sys:Double x:Key="NavigationBackButtonWidth">40</sys:Double>
    <sys:Double x:Key="NavigationBackButtonHeight">36</sys:Double>

    <Style x:Key="NavigationBackButtonNormalStyle" TargetType="Button" BasedOn="{StaticResource DefaultButtonStyle}">
        <Setter Property="Background" Value="{DynamicResource NavigationViewBackButtonBackground}" />
        <Setter Property="Foreground" Value="{DynamicResource NavigationViewItemForegroundChecked}" />
        <Setter Property="FontFamily" Value="{DynamicResource SymbolThemeFontFamily}" />
        <Setter Property="FontSize" Value="16" />
        <Setter Property="Height" Value="{DynamicResource NavigationBackButtonHeight}" />
        <Setter Property="Width" Value="{DynamicResource NavigationBackButtonWidth}" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
        <Setter Property="primitives:FocusVisualHelper.UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" />
        <Setter Property="primitives:FocusVisualHelper.FocusVisualMargin" Value="0" />
        <Setter Property="Content">
            <Setter.Value>
                <StreamGeometry>M 20 10.625 L 2.441406 10.625 L 10.126953 18.310547 L 9.248047 19.189453 L 0.058594 10 L 9.248047 0.810547 L 10.126953 1.689453 L 2.441406 9.375 L 20 9.375 Z</StreamGeometry>
            </Setter.Value>
        </Setter>
        <Setter Property="Margin"  Value="4,2" />
        <Setter Property="primitives:ControlHelper.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border
                        x:Name="RootGrid"
                        Background="{TemplateBinding Background}"
                        CornerRadius="{TemplateBinding primitives:ControlHelper.CornerRadius}"
                        SnapsToDevicePixels="True">
                        <local:FontIconFallback
                            x:Name="Content"
                            FontSize="{TemplateBinding FontSize}"
                            FontFamily="{TemplateBinding FontFamily}"
                            Data="{TemplateBinding Content}"
                            Foreground="{TemplateBinding Foreground}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="RootGrid" Property="Background" Value="{DynamicResource NavigationViewButtonBackgroundPointerOver}" />
                            <Setter TargetName="Content" Property="Foreground" Value="{DynamicResource NavigationViewButtonForegroundPointerOver}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="RootGrid" Property="Background" Value="{DynamicResource NavigationViewButtonBackgroundPressed}" />
                            <Setter TargetName="Content" Property="Foreground" Value="{DynamicResource NavigationViewButtonForegroundPressed}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Content" Property="Foreground" Value="{DynamicResource NavigationViewButtonForegroundDisabled}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="NavigationBackButtonSmallStyle" TargetType="Button" BasedOn="{StaticResource NavigationBackButtonNormalStyle}">
        <Setter Property="FontSize" Value="20" />
        <Setter Property="Height" Value="32" />
        <Setter Property="Width" Value="32" />
    </Style>

</ResourceDictionary>