<!-- 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:ui="http://schemas.modernwpf.com/2019"
    xmlns:local="clr-namespace:ModernWpf.Controls"
    xmlns:primitives="clr-namespace:ModernWpf.Controls.Primitives">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/ModernWpf;component/Styles/Button.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <ui:CornerRadiusFilterConverter x:Key="TopLeftCornerRadiusDoubleValueConverter" Filter="TopLeftValue" />
    <ui:CornerRadiusFilterConverter x:Key="BottomRightCornerRadiusDoubleValueConverter" Filter="BottomRightValue" />

    <StreamGeometry x:Key="More">M 2.5 8.75 C 2.675781 8.75 2.838542 8.782553 2.988281 8.847656 C 3.138021 8.912761 3.269857 9 3.383789 9.116211 C 3.497721 9.230144 3.58724 9.361979 3.652344 9.511719 C 3.717448 9.661459 3.75 9.824219 3.75 10 C 3.75 10.175781 3.717448 10.338542 3.652344 10.488281 C 3.58724 10.638021 3.497721 10.769857 3.383789 10.883789 C 3.269857 11 3.138021 11.08724 2.988281 11.152344 C 2.838542 11.217448 2.675781 11.25 2.5 11.25 C 2.324219 11.25 2.161458 11.217448 2.011719 11.152344 C 1.861979 11.08724 1.730143 11 1.616211 10.883789 C 1.502279 10.769857 1.41276 10.638021 1.347656 10.488281 C 1.282552 10.338542 1.25 10.175781 1.25 10 C 1.25 9.824219 1.282552 9.661459 1.347656 9.511719 C 1.41276 9.361979 1.502279 9.230144 1.616211 9.116211 C 1.730143 9 1.861979 8.912761 2.011719 8.847656 C 2.161458 8.782553 2.324219 8.75 2.5 8.75 Z M 10 8.75 C 10.175781 8.75 10.338541 8.782553 10.488281 8.847656 C 10.638021 8.912761 10.769856 9 10.883789 9.116211 C 11 9.230144 11.087239 9.361979 11.152344 9.511719 C 11.217447 9.661459 11.25 9.824219 11.25 10 C 11.25 10.175781 11.217447 10.338542 11.152344 10.488281 C 11.087239 10.638021 11 10.769857 10.883789 10.883789 C 10.769856 11 10.638021 11.08724 10.488281 11.152344 C 10.338541 11.217448 10.175781 11.25 10 11.25 C 9.824219 11.25 9.661458 11.217448 9.511719 11.152344 C 9.361979 11.08724 9.230143 11 9.116211 10.883789 C 9 10.769857 8.91276 10.638021 8.847656 10.488281 C 8.782552 10.338542 8.75 10.175781 8.75 10 C 8.75 9.824219 8.782552 9.661459 8.847656 9.511719 C 8.91276 9.361979 9 9.230144 9.116211 9.116211 C 9.230143 9 9.361979 8.912761 9.511719 8.847656 C 9.661458 8.782553 9.824219 8.75 10 8.75 Z M 17.5 8.75 C 17.675781 8.75 17.838541 8.782553 17.988281 8.847656 C 18.13802 8.912761 18.269855 9 18.383789 9.116211 C 18.497721 9.230144 18.587238 9.361979 18.652344 9.511719 C 18.717447 9.661459 18.75 9.824219 18.75 10 C 18.75 10.175781 18.717447 10.338542 18.652344 10.488281 C 18.587238 10.638021 18.497721 10.769857 18.383789 10.883789 C 18.269855 11 18.13802 11.08724 17.988281 11.152344 C 17.838541 11.217448 17.675781 11.25 17.5 11.25 C 17.324219 11.25 17.161457 11.217448 17.011719 11.152344 C 16.861979 11.08724 16.730143 11 16.616211 10.883789 C 16.502277 10.769857 16.41276 10.638021 16.347656 10.488281 C 16.282551 10.338542 16.25 10.175781 16.25 10 C 16.25 9.824219 16.282551 9.661459 16.347656 9.511719 C 16.41276 9.361979 16.502277 9.230144 16.616211 9.116211 C 16.730143 9 16.861979 8.912761 17.011719 8.847656 C 17.161457 8.782553 17.324219 8.75 17.5 8.75 Z</StreamGeometry>

    <Style x:Key="DefaultContentControlStyle" TargetType="ContentControl">
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ContentControl">
                    <ContentPresenter Margin="{TemplateBinding Padding}"
                                      HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                      VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="NavigationViewOverflowButtonStyleWhenPaneOnTop" TargetType="Button" BasedOn="{StaticResource DefaultButtonStyle}">
        <Setter Property="Background" Value="{DynamicResource NavigationViewItemBackground}" />
        <Setter Property="Foreground" Value="{DynamicResource TopNavigationViewItemForeground}" />
        <Setter Property="BorderBrush" Value="{DynamicResource NavigationViewItemBorderBrush}" />
        <Setter Property="BorderThickness" Value="{DynamicResource NavigationViewItemBorderThickness}" />
        <Setter Property="Height" Value="{DynamicResource PaneToggleButtonHeight}" />
        <Setter Property="Width" Value="{DynamicResource TopNavigationViewOverflowButtonWidth}" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
        <Setter Property="ui:FocusVisualHelper.UseSystemFocusVisuals" Value="True" />
        <Setter Property="ui:FocusVisualHelper.FocusVisualMargin" Value="0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid
                        x:Name="RootGrid"
                        Height="{TemplateBinding Height}"
                        Width="{TemplateBinding Width}"
                        Background="{TemplateBinding Background}">
                        <Rectangle
                            x:Name="PointerRectangle"
                            Fill="Transparent"
                            Visibility="Collapsed"/>
                        <ui:FontIconFallback
                            x:Name="Icon"
                            VerticalAlignment="Center"
                            HorizontalAlignment="Center"
                            FontFamily="{DynamicResource SymbolThemeFontFamily}"
                            FontSize="16"
                            Data="{StaticResource More}"
                            Foreground="{TemplateBinding Foreground}"
                            IsHitTestVisible="False" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <!-- PointerOver -->
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="RootGrid" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundPointerOver}" />
                            <Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundPointerOver}" />
                            <Setter TargetName="Icon" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPointerOver}" />
                        </Trigger>
                        <!-- Pressed -->
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="RootGrid" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundPressed}" />
                            <Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundPressed}" />
                            <Setter TargetName="Icon" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPressed}" />
                        </Trigger>
                        <!-- Disabled -->
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Icon" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundDisabled}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="NavigationViewOverflowButtonNoLabelStyleWhenPaneOnTop" TargetType="Button" BasedOn="{StaticResource DefaultButtonStyle}">
        <Setter Property="Background" Value="{DynamicResource NavigationViewItemBackground}" />
        <Setter Property="Foreground" Value="{DynamicResource TopNavigationViewItemForeground}" />
        <Setter Property="BorderBrush" Value="{DynamicResource NavigationViewItemBorderBrush}" />
        <Setter Property="BorderThickness" Value="{DynamicResource NavigationViewItemBorderThickness}" />
        <Setter Property="Height" Value="{DynamicResource TopNavigationViewOverflowButtonHeight}" />
        <Setter Property="Width" Value="{DynamicResource TopNavigationViewOverflowButtonWidth}" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
        <Setter Property="ui:FocusVisualHelper.UseSystemFocusVisuals" Value="True" />
        <Setter Property="ui:FocusVisualHelper.FocusVisualMargin" Value="0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <ControlTemplate.Resources>
                        <StreamGeometry x:Key="ChevronDown">M 18.935547 4.560547 L 19.814453 5.439453 L 10 15.253906 L 0.185547 5.439453 L 1.064453 4.560547 L 10 13.496094 Z</StreamGeometry>
                    </ControlTemplate.Resources>
                    <Grid
                        x:Name="RootGrid"
                        Height="{TemplateBinding Height}"
                        Width="{TemplateBinding Width}"
                        Background="{TemplateBinding Background}">
                        <Rectangle
                            x:Name="PointerRectangle"
                            Fill="Transparent" />
                        <ui:FontIconFallback
                            x:Name="Icon"
                            VerticalAlignment="Center"
                            HorizontalAlignment="Center"
                            FontFamily="{DynamicResource SymbolThemeFontFamily}"
                            FontSize="20"
                            Data="{StaticResource More}"
                            Foreground="{TemplateBinding Foreground}"
                            IsHitTestVisible="False" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <!-- PointerOver -->
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="RootGrid" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundPointerOver}" />
                            <Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundPointerOver}" />
                            <Setter TargetName="Icon" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPointerOver}" />
                        </Trigger>
                        <!-- Pressed -->
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="RootGrid" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundPressed}" />
                            <Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundPressed}" />
                            <Setter TargetName="Icon" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPressed}" />
                        </Trigger>
                        <!-- Disabled -->
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Icon" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundDisabled}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="primitives:NavigationViewItemPresenter" x:Key="MUX_NavigationViewItemPresenterStyleWhenOnLeftPane">
        <Setter Property="Foreground" Value="{DynamicResource NavigationViewItemForeground}" />
        <Setter Property="Background" Value="{DynamicResource NavigationViewItemBackground}" />
        <Setter Property="BorderBrush" Value="{DynamicResource NavigationViewItemBorderBrush}" />
        <Setter Property="BorderThickness" Value="{DynamicResource NavigationViewItemBorderThickness}" />
        <Setter Property="UseSystemFocusVisuals" Value="True" />
        <Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="CornerRadius" Value="{DynamicResource OverlayCornerRadius}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="primitives:NavigationViewItemPresenter">
                    <Border x:Name="LayoutRoot"
                            MinHeight="{DynamicResource NavigationViewItemOnLeftMinHeight}"
                            Background="{TemplateBinding Background}"
                            CornerRadius="{TemplateBinding CornerRadius}"
                            Margin="{DynamicResource NavigationViewItemButtonMargin}"
                            ui:FocusVisualHelper.IsTemplateFocusTarget="True">
                        <Border.Resources>
                            <Storyboard x:Key="ExpandCollapseRotateExpandedStoryboard">
                                <DoubleAnimation
                                    Storyboard.TargetName="ExpandCollapseChevronRotateTransform"
                                    Storyboard.TargetProperty="Angle"
                                    From="0.0" To="180.0" Duration="0:0:0.1"/>
                            </Storyboard>
                            <Storyboard x:Key="ExpandCollapseRotateCollapsedStoryboard">
                                <DoubleAnimation
                                    Storyboard.TargetName="ExpandCollapseChevronRotateTransform"
                                    Storyboard.TargetProperty="Angle"
                                    From="180.0" To="0.0" Duration="0:0:0.1"/>
                            </Storyboard>
                        </Border.Resources>

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="PointerStates">
                                <ui:VisualStateGroupListener.Listener>
                                    <ui:VisualStateGroupListener x:Name="PointerStatesListener" />
                                </ui:VisualStateGroupListener.Listener>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="PointerOver" />
                                <VisualState x:Name="Pressed" />
                                <VisualState x:Name="Selected" />
                                <VisualState x:Name="PointerOverSelected" />
                                <VisualState x:Name="PressedSelected" />
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="DisabledStates">
                                <ui:VisualStateGroupListener.Listener>
                                    <ui:VisualStateGroupListener x:Name="DisabledStatesListener" />
                                </ui:VisualStateGroupListener.Listener>
                                <VisualState x:Name="Enabled"/>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="IconStates">
                                <VisualState x:Name="IconVisible" />
                                <VisualState x:Name="IconCollapsed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IconBox" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="IconColumn" Storyboard.TargetProperty="Width">
                                            <DiscreteDoubleKeyFrame KeyTime="0" Value="8" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="ChevronStates">
                                <VisualState x:Name="ChevronHidden"/>
                                <VisualState x:Name="ChevronVisibleOpen">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandCollapseChevron" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ExpandCollapseChevronRotateTransform" Storyboard.TargetProperty="Angle">
                                            <DiscreteDoubleKeyFrame KeyTime="0" Value="180" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ChevronVisibleClosed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandCollapseChevron" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ExpandCollapseChevronRotateTransform" Storyboard.TargetProperty="Angle">
                                            <DiscreteDoubleKeyFrame KeyTime="0" Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="PaneAndTopLevelItemStates">
                                <ui:VisualStateGroupListener.Listener>
                                    <ui:VisualStateGroupListener x:Name="PaneAndTopLevelItemStatesListener" />
                                </ui:VisualStateGroupListener.Listener>
                                <VisualState x:Name="NotClosedCompactAndTopLevelItem" />
                                <VisualState x:Name="ClosedCompactAndTopLevelItem" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Grid x:Name="PresenterContentRootGrid">
                            <!-- Wrap SelectionIndicator in a grid so that its offset is 0,0 - this enables the offset animation. -->
                            <Grid
                                Margin="4,0,0,0"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Center">

                                <Rectangle
                                    x:Name="SelectionIndicator"
                                    Width="3"
                                    Height="16"
                                    Fill="{DynamicResource NavigationViewSelectionIndicatorForeground}"
                                    Opacity="0.0"
                                    RadiusX="2"
                                    RadiusY="2"/>
                            </Grid>

                            <Grid
                                x:Name="ContentGrid"
                                MinHeight="{DynamicResource NavigationViewItemOnLeftMinHeight}"
                                HorizontalAlignment="Stretch">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>

                                <Border x:Name="IconColumn" Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.SmallerIconWidth}">
                                    <Viewbox x:Name="IconBox"
                                             Height="16"
                                             Margin="{DynamicResource NavigationViewItemOnLeftIconBoxMargin}">
                                        <ContentPresenter
                                            x:Name="Icon"
                                            Content="{TemplateBinding Icon}"
                                            TextElement.Foreground="{TemplateBinding Foreground}" />
                                    </Viewbox>
                                </Border>

                                <!-- Padding="{TemplateBinding Padding}" -->
                                <ContentPresenter
                                    x:Name="ContentPresenter"
                                    Grid.Column="1"
                                    Margin="{DynamicResource NavigationViewItemContentPresenterMargin}"
                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                    Content="{TemplateBinding Content}"
                                    TextElement.Foreground="{TemplateBinding Foreground}"
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                    ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"/>

                                <Grid
                                    x:Name="ExpandCollapseChevron"
                                    Grid.Column="2"
                                    Visibility="Collapsed"
                                    HorizontalAlignment="Right"
                                    Width="40"
                                    Margin="{DynamicResource NavigationViewItemExpandChevronMargin}"
                                    Background="Transparent">
                                    <ui:FontIconFallback
                                        Width="12"
                                        Height="12"
                                        RenderTransformOrigin="0.5, 0.5"
                                        x:Name="ExpandCollapseChevronIcon"
                                        Foreground="{DynamicResource NavigationViewItemForeground}"
                                        FontSize="{DynamicResource NavigationViewItemExpandedGlyphFontSize}"
                                        Data="{DynamicResource NavigationViewItemExpandedPath}"
                                        FontFamily="{DynamicResource SymbolThemeFontFamily}"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center">
                                        <ui:FontIconFallback.RenderTransform>
                                            <RotateTransform x:Name="ExpandCollapseChevronRotateTransform" Angle="0"/>
                                        </ui:FontIconFallback.RenderTransform>
                                    </ui:FontIconFallback>
                                </Grid>
                            </Grid>
                        </Grid>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="PointerOver">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource NavigationViewItemBackgroundPointerOver}" />
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource NavigationViewItemForegroundPointerOver}" />
                            <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource NavigationViewItemForegroundPointerOver}" />
                        </Trigger>
                        <Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="Pressed">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource NavigationViewItemBackgroundPressed}" />
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource NavigationViewItemForegroundPressed}" />
                            <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource NavigationViewItemForegroundPressed}" />
                        </Trigger>
                        <Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="Selected">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource NavigationViewItemBackgroundSelected}" />
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource NavigationViewItemForegroundSelected}" />
                            <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource NavigationViewItemForegroundSelected}" />
                        </Trigger>
                        <Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="PointerOverSelected">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource NavigationViewItemBackgroundSelectedPointerOver}" />
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource NavigationViewItemForegroundSelectedPointerOver}" />
                            <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource NavigationViewItemForegroundSelectedPointerOver}" />
                        </Trigger>
                        <Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="PressedSelected">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource NavigationViewItemBackgroundSelectedPressed}" />
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource NavigationViewItemForegroundSelectedPressed}" />
                            <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource NavigationViewItemForegroundSelectedPressed}" />
                        </Trigger>

                        <Trigger SourceName="DisabledStatesListener" Property="CurrentStateName" Value="Disabled">
                            <Setter TargetName="LayoutRoot" Property="Opacity" Value="{DynamicResource ListViewItemDisabledThemeOpacity}" />
                        </Trigger>

                        <Trigger SourceName="PaneAndTopLevelItemStatesListener" Property="CurrentStateName" Value="ClosedCompactAndTopLevelItem">
                            <Setter TargetName="ContentPresenter" Property="Margin" Value="{DynamicResource NavigationViewCompactItemContentPresenterMargin}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:NavigationViewItem" x:Key="MUX_NavigationViewSettingsItemStyleWhenOnTopPane">
        <Setter Property="Foreground" Value="{DynamicResource NavigationViewItemForeground}" />
        <Setter Property="Background" Value="{DynamicResource NavigationViewItemBackground}" />
        <Setter Property="BorderBrush" Value="{DynamicResource NavigationViewItemBorderBrush}" />
        <Setter Property="BorderThickness" Value="{DynamicResource NavigationViewItemBorderThickness}" />
        <Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
        <Setter Property="FontWeight" Value="Normal" />
        <Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
        <Setter Property="UseSystemFocusVisuals" Value="True" />
        <Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:NavigationViewItem">
                    <Border x:Name="LayoutRoot"
                            Background="{TemplateBinding Background}"
                            CornerRadius="{TemplateBinding CornerRadius}"
                            Margin="{DynamicResource NavigationViewItemButtonMargin}"
                            Height="{DynamicResource TopNavigationViewSettingsButtonHeight}"
                            Width="{DynamicResource TopNavigationViewSettingsButtonHeight}"
                            ui:FocusVisualHelper.IsTemplateFocusTarget="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="PointerStates">
                                <ui:VisualStateGroupListener.Listener>
                                    <ui:VisualStateGroupListener x:Name="PointerStatesListener" />
                                </ui:VisualStateGroupListener.Listener>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="PointerOver" />
                                <VisualState x:Name="Pressed" />
                                <VisualState x:Name="Selected" />
                                <VisualState x:Name="PointerOverSelected" />
                                <VisualState x:Name="PressedSelected" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DisabledStates">
                                <ui:VisualStateGroupListener.Listener>
                                    <ui:VisualStateGroupListener x:Name="DisabledStatesListener" />
                                </ui:VisualStateGroupListener.Listener>
                                <VisualState x:Name="Enabled"/>
                                <VisualState x:Name="Disabled">
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Rectangle
                                x:Name="PointerRectangle"
                                Fill="Transparent" />
                            <Grid x:Name="ContentGrid">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition x:Name="IconRow" Height="Auto" />
                                    <RowDefinition Height="*" />
                                </Grid.RowDefinitions>
                                <Viewbox
                                    x:Name="IconBox"
                                    Grid.Row="1"
                                    Grid.Column="1"
                                    Height="16"
                                    Margin="0"
                                    VerticalAlignment="Center"
                                    HorizontalAlignment="Center">
                                    <ContentPresenter
                                        x:Name="Icon"
                                        Content="{TemplateBinding Icon}"
                                        TextElement.Foreground="{TemplateBinding Foreground}" />
                                </Viewbox>
                            </Grid>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="PointerOver">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundPointerOver}" />
                            <Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundPointerOver}" />
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPointerOver}" />
                        </Trigger>
                        <Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="Pressed">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundPressed}" />
                            <Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundPressed}" />
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPressed}" />
                        </Trigger>
                        <Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="Selected">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundSelected}" />
                            <Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundSelected}" />
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource TopNavigationViewItemForegroundSelected}" />
                        </Trigger>
                        <Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="PointerOverSelected">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundPointerOver}" />
                            <Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundSelectedPointerOver}" />
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPointerOver}" />
                        </Trigger>
                        <Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="PressedSelected">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundPressed}" />
                            <Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundSelectedPressed}" />
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPressed}" />
                        </Trigger>
                        <Trigger SourceName="DisabledStatesListener" Property="CurrentStateName" Value="Disabled">
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource TopNavigationViewItemForegroundDisabled}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="primitives:NavigationViewItemPresenter" x:Key="MUX_NavigationViewItemPresenterStyleWhenOnTopPane">
        <Setter Property="Foreground" Value="{DynamicResource TopNavigationViewItemForeground}" />
        <Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="primitives:NavigationViewItemPresenter">
                    <Border x:Name="LayoutRoot"
                            Background="{TemplateBinding Background}"
                            ui:FocusVisualHelper.IsTemplateFocusTarget="True"
                            CornerRadius="{TemplateBinding CornerRadius}">
                        <Border.Resources>
                            <Storyboard x:Key="ExpandCollapseRotateExpandedStoryboard">
                                <DoubleAnimation
                                    Storyboard.TargetName="ExpandCollapseChevronRotateTransform"
                                    Storyboard.TargetProperty="Angle"
                                    From="0.0" To="180.0" Duration="0:0:0.1"/>
                            </Storyboard>
                            <Storyboard x:Key="ExpandCollapseRotateCollapsedStoryboard">
                                <DoubleAnimation
                                    Storyboard.TargetName="ExpandCollapseChevronRotateTransform"
                                    Storyboard.TargetProperty="Angle"
                                    From="180.0" To="0.0" Duration="0:0:0.1"/>
                            </Storyboard>
                        </Border.Resources>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="PointerStates">
                                <ui:VisualStateGroupListener.Listener>
                                    <ui:VisualStateGroupListener x:Name="PointerStatesListener" />
                                </ui:VisualStateGroupListener.Listener>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="PointerOver" />
                                <VisualState x:Name="Pressed" />
                                <VisualState x:Name="Selected" />
                                <VisualState x:Name="PointerOverSelected" />
                                <VisualState x:Name="PressedSelected" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DisabledStates">
                                <ui:VisualStateGroupListener.Listener>
                                    <ui:VisualStateGroupListener x:Name="DisabledStatesListener" />
                                </ui:VisualStateGroupListener.Listener>
                                <VisualState x:Name="Enabled"/>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="NavigationViewIconPositionStates">
                                <ui:VisualStateGroupListener.Listener>
                                    <ui:VisualStateGroupListener x:Name="NavigationViewIconPositionStatesListener" />
                                </ui:VisualStateGroupListener.Listener>
                                <VisualState x:Name="IconOnLeft" />
                                <VisualState x:Name="IconOnly" />
                                <VisualState x:Name="ContentOnly" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ChevronStates">
                                <VisualState x:Name="ChevronHidden"/>
                                <VisualState x:Name="ChevronVisibleOpen">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandCollapseChevron" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ExpandCollapseChevronRotateTransform" Storyboard.TargetProperty="Angle">
                                            <DiscreteDoubleKeyFrame KeyTime="0" Value="180" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ChevronVisibleClosed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandCollapseChevron" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ExpandCollapseChevronRotateTransform" Storyboard.TargetProperty="Angle">
                                            <DiscreteDoubleKeyFrame KeyTime="0" Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Rectangle
                                x:Name="PointerRectangle"
                                Fill="Transparent"
                                Visibility="Collapsed" />
                            <Grid x:Name="ContentGrid">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Viewbox
                                    x:Name="IconBox"
                                    Height="16"
                                    Width="16"
                                    Margin="12,0,0,0"
                                    VerticalAlignment="Center"
                                    HorizontalAlignment="Center">
                                    <ContentPresenter
                                        x:Name="Icon"
                                        Content="{TemplateBinding Icon}"
                                        TextElement.Foreground="{TemplateBinding Foreground}"/>
                                </Viewbox>
                                <ui:ContentPresenterEx
                                    x:Name="ContentPresenter"
                                    Grid.Column="1"
                                    Margin="{DynamicResource TopNavigationViewItemContentPresenterMargin}"
                                    TextWrapping="NoWrap"
                                    Foreground="{TemplateBinding Foreground}"
                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                    Content="{TemplateBinding Content}"
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                    VerticalAlignment="Center"/>
                                <Grid
                                    x:Name="ExpandCollapseChevron"
                                    Grid.Column="2"
                                    Visibility="Collapsed"
                                    HorizontalAlignment="Right"
                                    Width="40"
                                    Margin="{DynamicResource TopNavigationViewItemExpandChevronMargin}"
                                    Background="Transparent">
                                    <ui:FontIconFallback
                                        Width="12"
                                        Height="12"
                                        Foreground="{DynamicResource NavigationViewItemForeground}"
                                        RenderTransformOrigin="0.5, 0.5"
                                        x:Name="ExpandCollapseChevronIcon"
                                        FontSize="{DynamicResource NavigationViewItemExpandedGlyphFontSize}"
                                        Data="{DynamicResource NavigationViewItemExpandedPath}"
                                        FontFamily="{DynamicResource SymbolThemeFontFamily}"
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center">
                                        <ui:FontIconFallback.RenderTransform>
                                            <RotateTransform x:Name="ExpandCollapseChevronRotateTransform" Angle="0"/>
                                        </ui:FontIconFallback.RenderTransform>
                                    </ui:FontIconFallback>
                                </Grid>
                            </Grid>
                            <Grid
                                x:Name="SelectionIndicatorGrid"
                                Margin="16,0,16,4"
                                VerticalAlignment="Bottom"
                                HorizontalAlignment="Center">
                                <Rectangle
                                    x:Name="SelectionIndicator"
                                    Height="3"
                                    Width="16"
                                    Fill="{DynamicResource NavigationViewSelectionIndicatorForeground}"
                                    Opacity="0"
                                    RadiusX="2"
                                    RadiusY="2" />
                            </Grid>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="PointerOver">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundPointerOver}" />
                            <Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundPointerOver}" />
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPointerOver}" />
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPointerOver}" />
                        </Trigger>
                        <Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="Pressed">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundPressed}" />
                            <Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundPressed}" />
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPressed}" />
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundPressed}" />
                        </Trigger>
                        <Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="Selected">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundSelected}" />
                            <Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundSelected}" />
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource TopNavigationViewItemForegroundSelected}" />
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundSelected}" />
                        </Trigger>
                        <Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="PointerOverSelected">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundPointerOver}" />
                            <Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundSelectedPointerOver}" />
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource TopNavigationViewItemForegroundSelectedPointerOver}" />
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundSelectedPointerOver}" />
                        </Trigger>
                        <Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="PressedSelected">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource TopNavigationViewItemBackgroundPressed}" />
                            <Setter TargetName="PointerRectangle" Property="Fill" Value="{DynamicResource NavigationViewItemBackgroundSelectedPressed}" />
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource TopNavigationViewItemForegroundSelectedPressed}" />
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundSelectedPressed}" />
                        </Trigger>
                        <Trigger SourceName="DisabledStatesListener" Property="CurrentStateName" Value="Disabled">
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource TopNavigationViewItemForegroundDisabled}" />
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundDisabled}" />
                        </Trigger>
                        <Trigger SourceName="NavigationViewIconPositionStatesListener" Property="CurrentStateName" Value="IconOnly">
                            <Setter TargetName="LayoutRoot" Property="Width" Value="36" />
                            <Setter TargetName="LayoutRoot" Property="Height" Value="36" />
                            <Setter TargetName="LayoutRoot" Property="Margin" Value="2" />
                            <Setter TargetName="IconBox" Property="Margin" Value="10,0" />
                            <Setter TargetName="ContentPresenter" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="SelectionIndicatorGrid" Property="Margin" Value="0" />
                            <Setter TargetName="ExpandCollapseChevron" Property="Margin" Value="{DynamicResource TopNavigationViewItemIconOnlyExpandChevronMargin}" />
                        </Trigger>
                        <Trigger SourceName="NavigationViewIconPositionStatesListener" Property="CurrentStateName" Value="ContentOnly">
                            <Setter TargetName="IconBox" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="ContentPresenter" Property="Margin" Value="{DynamicResource TopNavigationViewItemContentOnlyContentPresenterMargin}" />
                            <Setter TargetName="SelectionIndicatorGrid" Property="Margin" Value="12,0,12,4" />
                            <Setter TargetName="ExpandCollapseChevron" Property="Margin" Value="{DynamicResource TopNavigationViewItemContentOnlyExpandChevronMargin}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="primitives:NavigationViewItemPresenter" x:Key="MUX_NavigationViewItemPresenterStyleWhenOnTopPaneOverflow">
        <Setter Property="Foreground" Value="{DynamicResource TopNavigationViewItemForeground}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="primitives:NavigationViewItemPresenter">
                    <Grid
                        x:Name="LayoutRoot"
                        Height="36"
                        Background="{TemplateBinding Background}">
                        <Grid.Resources>
                            <Storyboard x:Key="ExpandCollapseRotateExpandedStoryboard">
                                <DoubleAnimation
                                    Storyboard.TargetName="ExpandCollapseChevronRotateTransform"
                                    Storyboard.TargetProperty="Angle"
                                    From="0.0" To="180.0" Duration="0:0:0.1"/>
                            </Storyboard>
                            <Storyboard x:Key="ExpandCollapseRotateCollapsedStoryboard">
                                <DoubleAnimation
                                    Storyboard.TargetName="ExpandCollapseChevronRotateTransform"
                                    Storyboard.TargetProperty="Angle"
                                    From="180.0" To="0.0" Duration="0:0:0.1"/>
                            </Storyboard>
                        </Grid.Resources>

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="PointerStates">
                                <ui:VisualStateGroupListener.Listener>
                                    <ui:VisualStateGroupListener x:Name="PointerStatesListener" />
                                </ui:VisualStateGroupListener.Listener>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="PointerOver" />
                                <VisualState x:Name="Pressed" />
                                <VisualState x:Name="Selected" />
                                <VisualState x:Name="PointerOverSelected" />
                                <VisualState x:Name="PressedSelected" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DisabledStates">
                                <ui:VisualStateGroupListener.Listener>
                                    <ui:VisualStateGroupListener x:Name="DisabledStatesListener" />
                                </ui:VisualStateGroupListener.Listener>
                                <VisualState x:Name="Enabled"/>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="NavigationViewIconPositionStates">
                                <ui:VisualStateGroupListener.Listener>
                                    <ui:VisualStateGroupListener x:Name="NavigationViewIconPositionStatesListener" />
                                </ui:VisualStateGroupListener.Listener>
                                <VisualState x:Name="IconOnLeft" />
                                <VisualState x:Name="IconOnly" />
                                <VisualState x:Name="ContentOnly" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ChevronStates">
                                <VisualState x:Name="ChevronHidden"/>
                                <VisualState x:Name="ChevronVisibleOpen">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandCollapseChevron" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ChevronVisibleClosed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandCollapseChevron" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="PresenterContentRootGrid">
                            <!-- Wrap SelectionIndicator in a grid so that its offset is 0,0 - this enables the offset animation. -->
                            <Grid
                                Margin="4,0,0,0"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Center">

                                <Rectangle
                                    x:Name="SelectionIndicator"
                                    Width="2"
                                    Height="24"
                                    Fill="{DynamicResource NavigationViewSelectionIndicatorForeground}"
                                    Opacity="0.0"
                                    RadiusX="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TopLeftCornerRadiusDoubleValueConverter}}"
                                    RadiusY="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BottomRightCornerRadiusDoubleValueConverter}}"/>
                            </Grid>
                            <Grid x:Name="ContentGrid">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Viewbox
                                    x:Name="IconBox"
                                    Height="16"
                                    Width="16"
                                    Margin="16,0,0,0"
                                    VerticalAlignment="Center"
                                    HorizontalAlignment="Center">
                                    <ContentPresenter
                                        x:Name="Icon"
                                        Content="{TemplateBinding Icon}"
                                        TextElement.Foreground="{TemplateBinding Foreground}" />
                                </Viewbox>
                                <ui:ContentPresenterEx
                                    x:Name="ContentPresenter"
                                    Grid.Column="1"
                                    Margin="{DynamicResource TopNavigationViewItemOnOverflowContentPresenterMargin}"
                                    Foreground="{TemplateBinding Foreground}"
                                    TextWrapping="NoWrap"
                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                    Content="{TemplateBinding Content}"
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                    VerticalAlignment="Center"/>
                                <Grid
                                    x:Name="ExpandCollapseChevron"
                                    Grid.Column="2"
                                    Visibility="Collapsed"
                                    HorizontalAlignment="Right"
                                    Width="40"
                                    Margin="{DynamicResource TopNavigationViewItemOnOverflowExpandChevronMargin}"
                                    Background="Transparent">
                                    <Border Padding="{DynamicResource TopNavigationViewItemOnOverflowExpandChevronPadding}">
                                        <ui:FontIconFallback
                                            Foreground="{DynamicResource NavigationViewItemForeground}"
                                            Width="12"
                                            Height="12"
                                            RenderTransformOrigin="0.5, 0.5"
                                            x:Name="ExpandCollapseChevronIcon"
                                            FontSize="{DynamicResource NavigationViewItemExpandedGlyphFontSize}"
                                            Data="{DynamicResource NavigationViewItemExpandedPath}"
                                            FontFamily="{DynamicResource SymbolThemeFontFamily}"
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center">
                                            <ui:FontIconFallback.RenderTransform>
                                                <RotateTransform x:Name="ExpandCollapseChevronRotateTransform" Angle="0"/>
                                            </ui:FontIconFallback.RenderTransform>
                                        </ui:FontIconFallback>
                                    </Border>
                                </Grid>
                            </Grid>
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="PointerOver">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource NavigationViewItemBackgroundPointerOver}" />
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource NavigationViewItemForegroundPointerOver}" />
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource NavigationViewItemForegroundPointerOver}" />
                        </Trigger>
                        <Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="Pressed">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource NavigationViewItemBackgroundPressed}" />
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource NavigationViewItemForegroundPressed}" />
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource NavigationViewItemForegroundPressed}" />
                        </Trigger>
                        <Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="Selected">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource NavigationViewItemBackgroundSelected}" />
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource NavigationViewItemForegroundSelected}" />
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource NavigationViewItemForegroundSelected}" />
                        </Trigger>
                        <Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="PointerOverSelected">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource NavigationViewItemBackgroundSelectedPointerOver}" />
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource NavigationViewItemForegroundPointerOver}" />
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource NavigationViewItemForegroundPointerOver}" />
                        </Trigger>
                        <Trigger SourceName="PointerStatesListener" Property="CurrentStateName" Value="PressedSelected">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource NavigationViewItemBackgroundSelectedPressed}" />
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource NavigationViewItemForegroundPressed}" />
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource NavigationViewItemForegroundPressed}" />
                        </Trigger>
                        <Trigger SourceName="DisabledStatesListener" Property="CurrentStateName" Value="Disabled">
                            <Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource TopNavigationViewItemForegroundDisabled}" />
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForegroundDisabled}" />
                        </Trigger>
                        <Trigger SourceName="NavigationViewIconPositionStatesListener" Property="CurrentStateName" Value="ContentOnly">
                            <Setter TargetName="IconBox" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="ContentPresenter" Property="Margin" Value="{DynamicResource TopNavigationViewItemOnOverflowNoIconContentPresenterMargin}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:NavigationView">
        <Setter Property="PaneToggleButtonStyle" Value="{DynamicResource PaneToggleButtonStyle}" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="CompactPaneLength" Value="{DynamicResource NavigationViewCompactPaneLength}" />
        <Setter Property="CornerRadius" Value="{DynamicResource OverlayCornerRadius}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:NavigationView">
                    <Grid x:Name="RootGrid"
                          KeyboardNavigation.TabNavigation="Local">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="DisplayModeGroup">
                                <ui:VisualStateGroupListener.Listener>
                                    <ui:VisualStateGroupListener x:Name="DisplayModeGroupListener" />
                                </ui:VisualStateGroupListener.Listener>
                                <VisualState x:Name="Compact" />
                                <VisualState x:Name="Expanded" />
                                <VisualState x:Name="Minimal" />
                                <VisualState x:Name="TopNavigationMinimal" />
                                <VisualState x:Name="MinimalWithBackButton" />
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="TogglePaneGroup">
                                <VisualState x:Name="TogglePaneButtonCollapsed" />
                                <VisualState x:Name="TogglePaneButtonVisible">
                                    <Storyboard>
                                        <!-- Might not need this setter when all the margins/paddings will be adequately set. -->
                                        <!-- This MinHeight setter is only here to ensure that AutoSuggestBox doesn't draw over ToggelButton. -->
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneContentGridToggleButtonRow" Storyboard.TargetProperty="MinHeight">
                                            <DiscreteDoubleKeyFrame KeyTime="0" Value="{DynamicResource NavigationViewPaneHeaderRowMinHeight}"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="HeaderGroup">
                                <VisualState x:Name="HeaderVisible" />
                                <VisualState x:Name="HeaderCollapsed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContent" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="AutoSuggestGroup">
                                <VisualState x:Name="AutoSuggestBoxVisible" />
                                <VisualState x:Name="AutoSuggestBoxCollapsed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="AutoSuggestArea" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TopPaneAutoSuggestArea" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="PaneStateGroup">
                                <VisualState x:Name="NotClosedCompact" />
                                <VisualState x:Name="ClosedCompact">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneAutoSuggestBoxPresenter" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneAutoSuggestButton" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="PaneStateListSizeGroup">
                                <ui:VisualStateGroupListener.Listener>
                                    <ui:VisualStateGroupListener x:Name="PaneStateListSizeGroupListener" />
                                </ui:VisualStateGroupListener.Listener>
                                <VisualState x:Name="ListSizeFull"/>
                                <VisualState x:Name="ListSizeCompact"/>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="PaneOverlayGroup">
                                <ui:VisualStateGroupListener.Listener>
                                    <ui:VisualStateGroupListener x:Name="PaneOverlayGroupListener" />
                                </ui:VisualStateGroupListener.Listener>
                                <VisualState x:Name="PaneOverlaying" />
                                <VisualState x:Name="PaneNotOverlaying" />
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="TitleBarVisibilityGroup">
                                <VisualState x:Name="TitleBarVisible" />
                                <VisualState x:Name="TitleBarCollapsed">
                                    <Storyboard>
                                        <ThicknessAnimationUsingKeyFrames Storyboard.TargetName="PaneContentGrid" Storyboard.TargetProperty="Margin">
                                            <DiscreteThicknessKeyFrame KeyTime="0" Value="0,32,0,0" />
                                        </ThicknessAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="OverflowLabelGroup">
                                <ui:VisualStateGroupListener.Listener>
                                    <ui:VisualStateGroupListener x:Name="OverflowLabelGroupListener" />
                                </ui:VisualStateGroupListener.Listener>
                                <VisualState x:Name="OverflowButtonWithLabel" />
                                <VisualState x:Name="OverflowButtonNoLabel" />
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="BackButtonGroup">
                                <VisualState x:Name="BackButtonVisible" />
                                <VisualState x:Name="BackButtonCollapsed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackButtonPlaceholderOnTopNav" Storyboard.TargetProperty="Width">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <GridLength>0</GridLength>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="PaneVisibilityGroup">
                                <VisualState x:Name="PaneVisible" />
                                <VisualState x:Name="PaneCollapsed">
                                    <Storyboard>
                                        <!-- Note that RootSplitView.DisplayMode is set in code so we don't want to -->
                                        <!-- write it here and interfere. But these values work together to hide -->
                                        <!-- the left pane. -->
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootSplitView" Storyboard.TargetProperty="CompactPaneLength">
                                            <DiscreteDoubleKeyFrame KeyTime="0" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PaneToggleButtonGrid" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="PaneSeparatorStates">
                                <VisualState x:Name="SeparatorCollapsed"/>
                                <VisualState x:Name="SeparatorVisible">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VisualItemsSeparator" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <!-- Button grid -->
                        <Grid
                            x:Name="PaneToggleButtonGrid"
                            Margin="0,0,0,8"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Top"
                            Canvas.ZIndex="100"
                            KeyboardNavigation.TabNavigation="Local"
                            KeyboardNavigation.TabIndex="0">

                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <Grid x:Name="TogglePaneTopPadding"
                                  Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPadding}"/>

                            <Grid x:Name="ButtonHolderGrid" Margin="0,4" Grid.Row="1">
                                <Button
                                    x:Name="NavigationViewBackButton"
                                    Style="{DynamicResource NavigationBackButtonNormalStyle}"
                                    Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.SmallerPaneToggleButtonWidth}"
                                    VerticalAlignment="Top"
                                    Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.BackButtonVisibility}"
                                    IsEnabled="{TemplateBinding IsBackEnabled}">
                                    <ToolTipService.ToolTip>
                                        <ToolTip x:Name="NavigationViewBackButtonToolTip"/>
                                    </ToolTipService.ToolTip>
                                </Button>
                                <Button
                                    x:Name="NavigationViewCloseButton"
                                    Style="{DynamicResource NavigationBackButtonNormalStyle}"
                                    VerticalAlignment="Top">
                                    <ToolTipService.ToolTip>
                                        <ToolTip x:Name="NavigationViewCloseButtonToolTip"/>
                                    </ToolTipService.ToolTip>
                                </Button>
                                <Button
                                    x:Name="TogglePaneButton"
                                    Style="{TemplateBinding PaneToggleButtonStyle}"
                                    HorizontalAlignment="Center"
                                    Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneToggleButtonVisibility}"
                                    VerticalAlignment="Top"
                                    MinWidth="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.SmallerPaneToggleButtonWidth}"
                                    ui:FocusVisualHelper.FocusVisualMargin="0">
                                    <TextBlock
                                        x:Name="PaneTitleTextBlock"
                                        Grid.Column="0"
                                        Text="{TemplateBinding PaneTitle}"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Center"
                                        Style="{DynamicResource NavigationViewItemHeaderTextStyle}"/>
                                </Button>

                                <Grid
                                    x:Name="PaneTitleHolder"
                                    Visibility="Collapsed">
                                    <ContentControl
                                        x:Name="PaneTitlePresenter"
                                        Style="{StaticResource DefaultContentControlStyle}"
                                        Margin="{DynamicResource NavigationViewPaneTitlePresenterMargin}"
                                        IsTabStop="False"
                                        HorizontalContentAlignment="Stretch"
                                        VerticalContentAlignment="Stretch"/>
                                </Grid>
                            </Grid>
                        </Grid>

                        <!-- Content layouts -->
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>

                            <!-- DisplayMode top -->
                            <StackPanel
                                x:Name="TopNavArea"
                                Background="{DynamicResource NavigationViewTopPaneBackground}"
                                Grid.Row="0"
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Top"
                                Canvas.ZIndex="1">

                                <Grid x:Name="TopNavTopPadding"
                                      Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPadding}"
                                      Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPaneVisibility}"/>

                                <Grid x:Name="TopNavGrid"
                                      Height="{DynamicResource NavigationViewTopPaneHeight}"
                                      Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPaneVisibility}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition x:Name="BackButtonPlaceholderOnTopNav" ui:ColumnDefinitionHelper.PixelWidth="{DynamicResource NavigationBackButtonWidth}"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*" MinWidth="{DynamicResource TopNavigationViewPaneCustomContentMinWidth}"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>

                                    <Grid
                                        x:Name="TopNavLeftPadding"
                                        Grid.Column="1"
                                        Width="0"/>

                                    <ContentControl
                                        x:Name="PaneHeaderOnTopPane"
                                        Style="{StaticResource DefaultContentControlStyle}"
                                        IsTabStop="False"
                                        VerticalContentAlignment="Stretch"
                                        HorizontalContentAlignment="Stretch"
                                        Grid.Column="2"/>

                                    <ContentControl
                                        x:Name="PaneTitleOnTopPane"
                                        Style="{StaticResource DefaultContentControlStyle}"
                                        IsTabStop="False"
                                        VerticalContentAlignment="Stretch"
                                        HorizontalContentAlignment="Stretch"
                                        Grid.Column="2"/>

                                    <!-- Top nav ItemsRepeater -->
                                    <local:ItemsRepeaterScrollHost
                                        Grid.Column="3">
                                        <ScrollViewer
                                            HorizontalScrollBarVisibility="Hidden"
                                            VerticalScrollBarVisibility="Hidden">
                                            <local:ItemsRepeater
                                                AutomationProperties.Name="{TemplateBinding AutomationProperties.Name}"
                                                x:Name="TopNavMenuItemsHost">
                                                <local:ItemsRepeater.Layout>
                                                    <local:StackLayout Orientation="Horizontal"/>
                                                </local:ItemsRepeater.Layout>
                                            </local:ItemsRepeater>
                                        </ScrollViewer>
                                    </local:ItemsRepeaterScrollHost>

                                    <Button
                                        x:Name="TopNavOverflowButton"
                                        Grid.Column="4"
                                        Content="More"
                                        Margin="{DynamicResource TopNavigationViewOverflowButtonMargin}"
                                        Style="{StaticResource NavigationViewOverflowButtonStyleWhenPaneOnTop}"
                                        Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.OverflowButtonVisibility}">

                                        <local:FlyoutService.Flyout>
                                            <local:Flyout
                                                Placement="BottomEdgeAlignedRight">
                                                <local:Flyout.FlyoutPresenterStyle>
                                                    <Style TargetType="local:FlyoutPresenter">
                                                        <Setter Property="Padding" Value="{DynamicResource TopNavigationViewOverflowMenuPadding}" />
                                                        <!-- Set negative top margin to make the flyout align exactly with the button -->
                                                        <!--<Setter Property="Margin" Value="0,-4,0,0" />-->
                                                    </Style>
                                                </local:Flyout.FlyoutPresenterStyle>
                                                <local:ItemsRepeaterScrollHost>
                                                    <ScrollViewer VerticalScrollBarVisibility="Auto">
                                                        <local:ItemsRepeater
                                                            x:Name="TopNavMenuItemsOverflowHost"/>
                                                    </ScrollViewer>
                                                </local:ItemsRepeaterScrollHost>
                                            </local:Flyout>
                                        </local:FlyoutService.Flyout>
                                    </Button>

                                    <ContentControl
                                        x:Name="PaneCustomContentOnTopPane"
                                        Style="{StaticResource DefaultContentControlStyle}"
                                        IsTabStop="False"
                                        VerticalContentAlignment="Stretch"
                                        HorizontalContentAlignment="Stretch"
                                        Grid.Column="5"/>

                                    <Grid
                                        x:Name="TopPaneAutoSuggestArea"
                                        Height="{DynamicResource NavigationViewTopPaneHeight}"
                                        Grid.Column="6">

                                        <ContentControl
                                            x:Name="TopPaneAutoSuggestBoxPresenter"
                                            Style="{StaticResource DefaultContentControlStyle}"
                                            Margin="{DynamicResource TopNavigationViewAutoSuggestBoxMargin}"
                                            MinWidth="48"
                                            IsTabStop="False"
                                            HorizontalContentAlignment="Stretch"
                                            VerticalContentAlignment="Center"/>
                                    </Grid>

                                    <ContentControl
                                        x:Name="PaneFooterOnTopPane"
                                        Style="{StaticResource DefaultContentControlStyle}"
                                        IsTabStop="False"
                                        VerticalContentAlignment="Stretch"
                                        HorizontalContentAlignment="Stretch"
                                        Grid.Column="7" />
                                    <!-- Top footer menu ItemsRepeater -->
                                    <local:ItemsRepeater
                                        Grid.Column="8"
                                        x:Name="TopFooterMenuItemsHost">
                                        <local:ItemsRepeater.Layout>
                                            <local:StackLayout Orientation="Horizontal"/>
                                        </local:ItemsRepeater.Layout>
                                    </local:ItemsRepeater>

                                </Grid>
                                <Border
                                    x:Name="TopNavContentOverlayAreaGrid"
                                    ui:BorderHelper.Child="{TemplateBinding ContentOverlay}" />
                            </StackPanel>

                            <!-- Displaymode (compact/minimal/normal) left -->
                            <local:SplitView
                                x:Name="RootSplitView"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{DynamicResource NavigationViewItemSeparatorForeground}"
                                BorderThickness="0"
                                CompactPaneLength="{TemplateBinding CompactPaneLength}"
                                DisplayMode="Inline"
                                IsPaneOpen="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsPaneOpen, Mode=TwoWay}"
                                IsTabStop="False"
                                OpenPaneLength="{TemplateBinding OpenPaneLength}"
                                PaneBackground="{DynamicResource NavigationViewDefaultPaneBackground}"
                                Grid.Row="1"
                                CornerRadius="{DynamicResource OverlayCornerRadius}">

                                <local:SplitView.Pane>
                                    <Border x:Name="PaneContentGrid"
                                            BorderBrush="{DynamicResource NavigationViewItemSeparatorForeground}"
                                            BorderThickness="0,0,1,0"
                                            HorizontalAlignment="Left"
                                            Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.LeftPaneVisibility}">
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="0"/>
                                                <!-- above button margin + back button space -->
                                                <RowDefinition x:Name="PaneContentGridToggleButtonRow" Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="8"/>
                                                <!-- above list margin -->
                                                <RowDefinition x:Name="ItemsContainerRow" Height="*"/>
                                            </Grid.RowDefinitions>

                                            <Grid x:Name="ContentPaneTopPadding"
                                                  Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPadding}"/>

                                            <Grid Grid.Row="2">
                                                <Grid.RowDefinitions>
                                                    <RowDefinition x:Name="PaneHeaderContentBorderRow"/>
                                                </Grid.RowDefinitions>

                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition x:Name="PaneHeaderCloseButtonColumn"/>
                                                    <ColumnDefinition x:Name="PaneHeaderToggleButtonColumn"/>
                                                    <ColumnDefinition Width="*"/>
                                                </Grid.ColumnDefinitions>

                                                <ContentControl
                                                    x:Name="PaneHeaderContentBorder"
                                                    Style="{StaticResource DefaultContentControlStyle}"
                                                    IsTabStop="False"
                                                    VerticalContentAlignment="Stretch"
                                                    HorizontalContentAlignment="Stretch"
                                                    Grid.Column="2" />
                                            </Grid>

                                            <Grid
                                                x:Name="AutoSuggestArea"
                                                Grid.Row="3"
                                                Height="{DynamicResource NavigationViewTopPaneHeight}"
                                                VerticalAlignment="Center">

                                                <ContentControl
                                                    x:Name="PaneAutoSuggestBoxPresenter"
                                                    Style="{StaticResource DefaultContentControlStyle}"
                                                    Margin="{DynamicResource NavigationViewAutoSuggestBoxMargin}"
                                                    IsTabStop="False"
                                                    HorizontalContentAlignment="Stretch"
                                                    VerticalContentAlignment="Center"/>

                                                <Button
                                                    x:Name="PaneAutoSuggestButton"
                                                    Visibility="Collapsed"
                                                    Style="{DynamicResource NavigationViewPaneSearchButtonStyle}"
                                                    Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.SmallerPaneToggleButtonWidth}">
                                                    <Button.Resources>
                                                        <ui:StaticResource x:Key="ButtonBackgroundPointerOver" ResourceKey="NavigationViewItemBackgroundPointerOver" />
                                                        <ui:StaticResource x:Key="ButtonBackgroundPressed" ResourceKey="NavigationViewItemBackgroundPressed" />
                                                        <ui:StaticResource x:Key="ButtonBackgroundDisabled" ResourceKey="NavigationViewItemBackgroundDisabled" />
                                                        <ui:StaticResource x:Key="ButtonForegroundPointerOver" ResourceKey="NavigationViewItemForegroundPointerOver" />
                                                        <ui:StaticResource x:Key="ButtonForegroundPressed" ResourceKey="NavigationViewItemForegroundPressed" />
                                                        <ui:StaticResource x:Key="ButtonForegroundDisabled" ResourceKey="NavigationViewItemForegroundDisabled" />
                                                        <ui:StaticResource x:Key="ButtonBorderBrushPointerOver" ResourceKey="NavigationViewItemBorderBrushPointerOver" />
                                                        <ui:StaticResource x:Key="ButtonBorderBrushPressed" ResourceKey="NavigationViewItemBorderBrushPressed" />
                                                        <ui:StaticResource x:Key="ButtonBorderBrushDisabled" ResourceKey="NavigationViewItemBorderBrushDisabled" />
                                                    </Button.Resources>
                                                </Button>
                                            </Grid>

                                            <ContentControl
                                                x:Name="PaneCustomContentBorder"
                                                Style="{StaticResource DefaultContentControlStyle}"
                                                IsTabStop="False"
                                                VerticalContentAlignment="Stretch"
                                                HorizontalContentAlignment="Stretch"
                                                Grid.Row="4" />

                                            <!-- "Non header" content -->
                                            <Grid x:Name="ItemsContainerGrid" Grid.Row="6" Margin="0,0,0,8">
                                                <Grid.RowDefinitions>
                                                    <RowDefinition Height="Auto"/> <!-- MenuItems -->
                                                    <RowDefinition Height="*"/> <!-- Fill spacing -->
                                                    <RowDefinition Height="Auto" /> <!-- PaneFooter -->
                                                    <RowDefinition Height="Auto"/> <!-- FooterItems -->
                                                </Grid.RowDefinitions>

                                                <!-- MenuItems -->
                                                <local:ItemsRepeaterScrollHost
                                                    HorizontalAlignment="Stretch"
                                                    VerticalAlignment="Stretch">
                                                    <ScrollViewer x:Name="MenuItemsScrollViewer"
                                                                  KeyboardNavigation.TabNavigation="Local"
                                                                  VerticalScrollBarVisibility="Auto">
                                                        <!-- Left nav ItemsRepeater -->
                                                        <local:ItemsRepeater
                                                            x:Name="MenuItemsHost"
                                                            AutomationProperties.Name="{TemplateBinding AutomationProperties.Name}"/>
                                                    </ScrollViewer>
                                                </local:ItemsRepeaterScrollHost>

                                                <local:NavigationViewItemSeparator x:Name="VisualItemsSeparator"
                                                                                   Grid.Row="1" VerticalAlignment="Center"
                                                                                   Visibility="Collapsed" HorizontalAlignment="Stretch"/>

                                                <!-- PaneFooter -->
                                                <ContentControl x:Name="FooterContentBorder"
                                                                Style="{StaticResource DefaultContentControlStyle}"
                                                                IsTabStop="False"
                                                                VerticalContentAlignment="Stretch"
                                                                HorizontalContentAlignment="Stretch"
                                                                Grid.Row="2" />

                                                <!-- FooterItems -->
                                                <local:ItemsRepeaterScrollHost Grid.Row="3">
                                                    <ScrollViewer x:Name="FooterItemsScrollViewer"
                                                                  VerticalScrollBarVisibility="Auto">
                                                        <!-- contract7Present:VerticalAnchorRatio="1" -->
                                                        <local:ItemsRepeater
                                                            x:Name="FooterMenuItemsHost" VerticalAlignment="Bottom"/>
                                                    </ScrollViewer>
                                                </local:ItemsRepeaterScrollHost>
                                            </Grid>

                                        </Grid>
                                    </Border>
                                </local:SplitView.Pane>

                                <local:SplitView.Content>
                                    <Grid x:Name="ContentGrid" Background="{DynamicResource NavigationViewContentBackground}">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="*" />
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="*"/>
                                        </Grid.ColumnDefinitions>

                                        <Grid x:Name="ContentTopPadding"
                                              Grid.ColumnSpan="2"
                                              Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.TopPadding}"
                                              Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.LeftPaneVisibility}"/>

                                        <Grid x:Name="ContentLeftPadding" Grid.Row="1"/>

                                        <ContentControl
                                            x:Name="HeaderContent"
                                            Grid.Row="1"
                                            Grid.Column="1"
                                            MinHeight="{DynamicResource PaneToggleButtonHeight}"
                                            IsTabStop="False"
                                            Content="{TemplateBinding Header}"
                                            ContentTemplate="{TemplateBinding HeaderTemplate}"
                                            VerticalContentAlignment="Stretch"
                                            HorizontalContentAlignment="Stretch"
                                            Style="{DynamicResource NavigationViewTitleHeaderContentControlTextStyle}"/>

                                        <ContentPresenter
                                            Grid.Row="2"
                                            Grid.ColumnSpan="2"
                                            Content="{TemplateBinding Content}"/>
                                    </Grid>
                                </local:SplitView.Content>
                            </local:SplitView>

                        </Grid>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger SourceName="DisplayModeGroupListener" Property="CurrentStateName" Value="Expanded">
                            <Setter TargetName="RootSplitView" Property="PaneBackground" Value="{DynamicResource NavigationViewExpandedPaneBackground}" />
                        </Trigger>
                        <Trigger SourceName="DisplayModeGroupListener" Property="CurrentStateName" Value="Minimal">
                            <Setter TargetName="HeaderContent" Property="Margin" Value="{DynamicResource NavigationViewMinimalHeaderMargin}" />
                        </Trigger>
                        <Trigger SourceName="DisplayModeGroupListener" Property="CurrentStateName" Value="MinimalWithBackButton">
                            <Setter TargetName="HeaderContent" Property="Margin" Value="{DynamicResource NavigationViewMinimalHeaderMargin}" />
                        </Trigger>

                        <Trigger SourceName="PaneStateListSizeGroupListener" Property="CurrentStateName" Value="ListSizeCompact">
                            <Setter TargetName="PaneContentGrid" Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CompactPaneLength}" />
                            <Setter TargetName="PaneTitleTextBlock" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="PaneHeaderContentBorder" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="PaneCustomContentBorder" Property="HorizontalAlignment" Value="Left" />
                            <Setter TargetName="FooterContentBorder" Property="HorizontalAlignment" Value="Left" />
                        </Trigger>

                        <Trigger SourceName="PaneOverlayGroupListener" Property="CurrentStateName" Value="PaneNotOverlaying">
                            <Setter TargetName="RootSplitView" Property="CornerRadius" Value="0" />
                            <Setter TargetName="RootSplitView" Property="BorderThickness" Value="0" />
                            <Setter TargetName="PaneContentGrid" Property="BorderThickness" Value="0,0,1,0" />
                            <Setter TargetName="RootSplitView" Property="PaneBackground" Value="{DynamicResource NavigationViewExpandedPaneBackground}" />
                        </Trigger>

                        <Trigger SourceName="OverflowLabelGroupListener" Property="CurrentStateName" Value="OverflowButtonNoLabel">
                            <Setter TargetName="TopNavOverflowButton" Property="Style" Value="{DynamicResource NavigationViewOverflowButtonNoLabelStyleWhenPaneOnTop}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:NavigationViewItem">
        <Setter Property="Foreground" Value="{DynamicResource NavigationViewItemForeground}" />
        <Setter Property="Background" Value="{DynamicResource NavigationViewItemBackground}" />
        <Setter Property="BorderBrush" Value="{DynamicResource NavigationViewItemBorderBrush}" />
        <Setter Property="BorderThickness" Value="{DynamicResource NavigationViewItemBorderThickness}" />
        <Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
        <Setter Property="FontWeight" Value="Normal" />
        <Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
        <Setter Property="Margin" Value="{DynamicResource NavigationViewItemMargin}" />
        <Setter Property="UseSystemFocusVisuals" Value="True" />
        <Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="KeyboardNavigation.TabNavigation" Value="Once"/>
        <Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:NavigationViewItem">
                    <Grid x:Name="NVIRootGrid">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ItemOnNavigationViewListPositionStates">
                                <ui:VisualStateGroupListener.Listener>
                                    <ui:VisualStateGroupListener x:Name="ItemOnNavigationViewListPositionStatesListener" />
                                </ui:VisualStateGroupListener.Listener>
                                <VisualState x:Name="OnLeftNavigation" />
                                <VisualState x:Name="OnTopNavigationPrimary">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ChildrenFlyout" Storyboard.TargetProperty="Placement">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static primitives:FlyoutPlacementMode.BottomEdgeAlignedLeft}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="OnTopNavigationOverflow" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <primitives:NavigationViewItemPresenter
                            x:Name="NavigationViewItemPresenter"
                            Icon="{TemplateBinding Icon}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            Padding="{TemplateBinding Padding}"
                            Foreground="{TemplateBinding Foreground}"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            UseSystemFocusVisuals="{TemplateBinding UseSystemFocusVisuals}"
                            VerticalAlignment="{TemplateBinding VerticalAlignment}"
                            HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                            ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                            Content="{TemplateBinding Content}"
                            CornerRadius="{TemplateBinding CornerRadius}"
                            IsTabStop="False"
                            ui:FocusVisualHelper.IsTemplateFocusTarget="True">
                        </primitives:NavigationViewItemPresenter>
                        <local:ItemsRepeater
                            Grid.Row="1"
                            Visibility="Collapsed"
                            x:Name="NavigationViewItemMenuItemsHost">
                            <local:ItemsRepeater.Layout>
                                <local:StackLayout Orientation="Vertical"/>
                            </local:ItemsRepeater.Layout>
                        </local:ItemsRepeater>
                        <primitives:FlyoutBase.AttachedFlyout>
                            <local:Flyout x:Name="ChildrenFlyout"
                                          Placement="RightEdgeAlignedTop">
                                <local:Flyout.FlyoutPresenterStyle>
                                    <Style TargetType="local:FlyoutPresenter">
                                        <Setter Property="Padding" Value="{DynamicResource TopNavigationViewOverflowMenuPadding}" />
                                        <!-- Set negative top margin to make the flyout align exactly with the button -->
                                        <!--<Setter Property="Margin" Value="0,-4,0,0" />-->
                                    </Style>
                                </local:Flyout.FlyoutPresenterStyle>
                                <Grid x:Name="FlyoutRootGrid">
                                    <Grid x:Name="FlyoutContentGrid"/>
                                </Grid>
                            </local:Flyout>
                        </primitives:FlyoutBase.AttachedFlyout>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <!-- OnLeftNavigation -->
                        <Trigger Property="CurrentStateName" Value="OnLeftNavigation" SourceName="ItemOnNavigationViewListPositionStatesListener">
                            <Setter TargetName="NavigationViewItemPresenter" Property="Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnLeftPane}" />
                        </Trigger>
                        <!-- OnLeftNavigationReveal -->
                        <!--
                        <Trigger Property="CurrentStateName" Value="OnLeftNavigationReveal" SourceName="ItemOnNavigationViewListPositionStatesListener">
                        <Setter TargetName="NavigationViewItemPresenter" Property="Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnLeftPaneWithRevealFocus}" />
                        </Trigger>
                        -->
                        <!-- OnTopNavigationPrimary -->
                        <Trigger Property="CurrentStateName" Value="OnTopNavigationPrimary" SourceName="ItemOnNavigationViewListPositionStatesListener">
                            <Setter TargetName="NavigationViewItemPresenter" Property="Margin" Value="{DynamicResource TopNavigationViewItemMargin}" />
                            <Setter TargetName="NavigationViewItemPresenter" Property="Foreground" Value="{DynamicResource TopNavigationViewItemForeground}" />
                            <Setter TargetName="NavigationViewItemPresenter" Property="Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPane}" />
                        </Trigger>
                        <!-- OnTopNavigationOverflow -->
                        <Trigger Property="CurrentStateName" Value="OnTopNavigationOverflow" SourceName="ItemOnNavigationViewListPositionStatesListener">
                            <Setter TargetName="NavigationViewItemPresenter" Property="Style" Value="{StaticResource MUX_NavigationViewItemPresenterStyleWhenOnTopPaneOverflow}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="primitives:NavigationViewItemPresenter" />

    <Style TargetType="local:NavigationViewItemHeader">
        <Setter Property="IsEnabled" Value="False" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="MinHeight" Value="0"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:NavigationViewItemHeader">
                    <Grid x:Name="NavigationViewItemHeaderRootGrid">
                        <VisualStateManager.CustomVisualStateManager>
                            <ui:SimpleVisualStateManager />
                        </VisualStateManager.CustomVisualStateManager>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="PaneStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition From="HeaderTextCollapsed" To="HeaderTextVisible">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="InnerHeaderGrid" Storyboard.TargetProperty="Height">
                                                <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="40" />
                                            </DoubleAnimationUsingKeyFrames>

                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderText" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{x:Static Visibility.Visible}" />
                                            </ObjectAnimationUsingKeyFrames>

                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HeaderText" Storyboard.TargetProperty="Opacity">
                                                <LinearDoubleKeyFrame KeyTime="0:0:0" Value="0.0"/>
                                                <LinearDoubleKeyFrame KeyTime="0:0:0.1" Value="0.0"/>
                                                <SplineDoubleKeyFrame
                                                    KeyTime="0:0:0.2"
                                                    KeySpline="0.0,0.35 0.15,1.0"
                                                    Value="1.0" />
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>

                                    <VisualTransition From="HeaderTextVisible" To="HeaderTextCollapsed">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="InnerHeaderGrid" Storyboard.TargetProperty="Height">
                                                <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="20" />
                                            </DoubleAnimationUsingKeyFrames>

                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderText" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0:0:0.2" Value="{x:Static Visibility.Collapsed}" />
                                            </ObjectAnimationUsingKeyFrames>

                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HeaderText" Storyboard.TargetProperty="Opacity">
                                                <LinearDoubleKeyFrame KeyTime="0:0:0" Value="1.0"/>
                                                <SplineDoubleKeyFrame
                                                    KeyTime="0:0:0.1"
                                                    KeySpline="0.0,0.35 0.15,1.0"
                                                    Value="0.0" />
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                </VisualStateGroup.Transitions>

                                <VisualState x:Name="HeaderTextVisible"/>
                                <VisualState x:Name="HeaderTextCollapsed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderText" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{x:Static Visibility.Collapsed}" />
                                        </ObjectAnimationUsingKeyFrames>

                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="InnerHeaderGrid" Storyboard.TargetProperty="Height">
                                            <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="20" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="InnerHeaderGrid" Height="40" HorizontalAlignment="Left" Margin="{DynamicResource NavigationViewItemInnerHeaderMargin}">
                            <TextBlock
                                x:Name="HeaderText"
                                VerticalAlignment="Center"
                                Margin="0,-1,0,-1"
                                Style="{DynamicResource NavigationViewItemHeaderTextStyle}"
                                Text="{TemplateBinding Content}"
                                TextWrapping="NoWrap"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:NavigationViewItemSeparator">
        <Setter Property="IsEnabled" Value="False" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="MinHeight" Value="0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Grid x:Name="NavigationViewItemSeparatorRootGrid">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="NavigationSeparatorLineStates">
                                <ui:VisualStateGroupListener.Listener>
                                    <ui:VisualStateGroupListener x:Name="NavigationSeparatorLineStatesListener" />
                                </ui:VisualStateGroupListener.Listener>
                                <VisualState x:Name="HorizontalLine" />
                                <VisualState x:Name="HorizontalLineCompact" />
                                <VisualState x:Name="VerticalLine" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle
                            x:Name="SeparatorLine"
                            Height="{DynamicResource NavigationViewItemSeparatorHeight}"
                            Margin="{DynamicResource NavigationViewItemSeparatorMargin}"
                            Fill="{DynamicResource NavigationViewItemSeparatorForeground}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <!-- HorizontalLineCompact -->
                        <Trigger SourceName="NavigationSeparatorLineStatesListener" Property="CurrentStateName" Value="HorizontalLineCompact">
                            <Setter TargetName="SeparatorLine" Property="Margin" Value="{DynamicResource NavigationViewCompactItemSeparatorMargin}" />
                        </Trigger>
                        <!-- VerticalLine -->
                        <Trigger SourceName="NavigationSeparatorLineStatesListener" Property="CurrentStateName" Value="VerticalLine">
                            <Setter TargetName="SeparatorLine" Property="Height" Value="24" />
                            <Setter TargetName="SeparatorLine" Property="Width" Value="{DynamicResource TopNavigationViewItemSeparatorWidth}" />
                            <Setter TargetName="SeparatorLine" Property="Margin" Value="{DynamicResource TopNavigationViewItemSeparatorMargin}" />
                            <Setter TargetName="SeparatorLine" Property="VerticalAlignment" Value="Center" />
                            <Setter TargetName="SeparatorLine" Property="Fill" Value="{DynamicResource TopNavigationViewItemSeparatorForeground}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>