<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:ModernWpf.Controls"
    xmlns:primitives="clr-namespace:ModernWpf.Controls.Primitives"
    xmlns:ui="http://schemas.modernwpf.com/2019">

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

    <Style x:Key="AppBarButtonOverflowStyle" TargetType="local:AppBarButton">
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="Width" Value="NaN" />
    </Style>

    <Style x:Key="AppBarToggleButtonOverflowStyle" TargetType="local:AppBarToggleButton">
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="Width" Value="NaN" />
    </Style>

    <Style x:Key="SplitButtonCommandBarStyle" TargetType="local:SplitButton">
        <Setter Property="Background" Value="{DynamicResource AppBarButtonBackground}" />
        <Setter Property="Foreground" Value="{DynamicResource AppBarButtonForeground}" />
        <Setter Property="BorderBrush" Value="{DynamicResource AppBarButtonBorderBrush}" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="HorizontalContentAlignment" Value="Right" />
        <Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
        <Setter Property="FontWeight" Value="Normal" />
        <Setter Property="FontSize" Value="12" />
        <Setter Property="UseSystemFocusVisuals" Value="True" />
        <Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
        <Setter Property="FocusVisualMargin" Value="-3" />
        <Setter Property="IsTabStop" Value="True"/>
        <Setter Property="Padding" Value="12,7,4,9"/>
        <Setter Property="Height" Value="{DynamicResource AppBarThemeCompactHeight}" />
        <Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:SplitButton">
                    <ControlTemplate.Resources>
                        <StreamGeometry x:Key="ChevronDownSmall">F1 M 17.568359 3.408203 L 19.931641 5.761719 L 10 15.693359 L 0.068359 5.761719 L 2.431641 3.408203 L 10 10.976562 L 17.568359 3.408203 Z</StreamGeometry>
                    </ControlTemplate.Resources>

                    <Border x:Name="RootGrid"
                            Background="Transparent"
                            Padding="{DynamicResource AppBarButtonInnerBorderMargin}"
                            SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="FlyoutOpen" />
                                <VisualState x:Name="TouchPressed" />
                                <VisualState x:Name="PrimaryPointerOver" />
                                <VisualState x:Name="PrimaryPressed" />
                                <VisualState x:Name="SecondaryPointerOver" />
                                <VisualState x:Name="SecondaryPressed" />
                                <VisualState x:Name="Checked" />
                                <VisualState x:Name="CheckedFlyoutOpen" />
                                <VisualState x:Name="CheckedTouchPressed" />
                                <VisualState x:Name="CheckedPrimaryPointerOver" />
                                <VisualState x:Name="CheckedPrimaryPressed" />
                                <VisualState x:Name="CheckedSecondaryPointerOver" />
                                <VisualState x:Name="CheckedSecondaryPressed" />
                                <ui:VisualStateGroupListener.Listener>
                                    <ui:VisualStateGroupListener x:Name="CommonStatesListener" />
                                </ui:VisualStateGroupListener.Listener>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="SecondaryButtonPlacementStates">
                                <VisualState x:Name="SecondaryButtonRight"/>

                                <VisualState x:Name="SecondaryButtonSpan">
                                    <VisualState.Storyboard>
                                        <Storyboard>
                                            <Int32AnimationUsingKeyFrames Storyboard.TargetName="SecondaryButton" Storyboard.TargetProperty="(Grid.Column)">
                                                <DiscreteInt32KeyFrame KeyTime="0" Value="0" />
                                            </Int32AnimationUsingKeyFrames>
                                            <Int32AnimationUsingKeyFrames Storyboard.TargetName="SecondaryButton" Storyboard.TargetProperty="(Grid.ColumnSpan)">
                                                <DiscreteInt32KeyFrame KeyTime="0" Value="3" />
                                            </Int32AnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState.Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Grid>
                            <Grid.Resources>
                                <!-- Override the style of the inner buttons so that they don't affect background/foreground/border colors -->
                                <Style TargetType="Button">
                                    <Setter Property="OverridesDefaultStyle" Value="True" />
                                    <Setter Property="Foreground" Value="{DynamicResource AppBarButtonForeground}" />
                                    <Setter Property="BorderBrush" Value="Transparent" />
                                    <Setter Property="BorderThickness" Value="0" />
                                    <Setter Property="HorizontalAlignment" Value="Left" />
                                    <Setter Property="VerticalAlignment" Value="Center" />
                                    <Setter Property="HorizontalContentAlignment" Value="Center" />
                                    <Setter Property="VerticalContentAlignment" Value="Center" />
                                    <Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
                                    <Setter Property="FontWeight" Value="Normal" />
                                    <Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
                                    <Setter Property="ui:FocusVisualHelper.UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" />
                                    <Setter Property="ui:FocusVisualHelper.FocusVisualMargin" Value="-3" />
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="Button">
                                                <Grid x:Name="RootGrid" Background="Transparent">
                                                    <Border BorderBrush="{TemplateBinding BorderBrush}"
                                                            BorderThickness="{TemplateBinding BorderThickness}"
                                                            Padding="{TemplateBinding Padding}">
                                                        <ContentPresenter x:Name="ContentPresenter"
                                                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                                                    </Border>
                                                </Grid>

                                                <ControlTemplate.Triggers>
                                                    <Trigger Property="IsEnabled" Value="False">
                                                        <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource AppBarButtonForegroundDisabled}" />
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </Grid.Resources>

                            <Grid.ColumnDefinitions>
                                <ColumnDefinition x:Name="PrimaryButtonColumn" Width="*"/>
                                <ColumnDefinition x:Name="SecondaryButtonColumn" Width="23"/>
                            </Grid.ColumnDefinitions>

                            <Border x:Name="PrimaryBackgroundGrid"
                                    Background="{TemplateBinding Background}"
                                    CornerRadius="{TemplateBinding CornerRadius, Converter={StaticResource LeftCornerRadiusFilterConverter}}" />

                            <Border x:Name="SecondaryBackgroundGrid"
                                    Background="{TemplateBinding Background}"
                                    CornerRadius="{TemplateBinding CornerRadius, Converter={StaticResource RightCornerRadiusFilterConverter}}"
                                    Grid.Column="1"/>

                            <Border x:Name="Border"
                                    Grid.ColumnSpan="2"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    CornerRadius="{TemplateBinding CornerRadius}"/>

                            <Button x:Name="PrimaryButton"
                                    Grid.Column="0"
                                    Foreground="{TemplateBinding Foreground}"
                                    Background="{TemplateBinding Background}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    BorderBrush="Transparent"
                                    Content="{TemplateBinding Content}"
                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                    Command="{TemplateBinding Command}"
                                    CommandParameter="{TemplateBinding CommandParameter}"
                                    FontFamily="{TemplateBinding FontFamily}"
                                    FontSize="{TemplateBinding FontSize}"
                                    FontWeight="{TemplateBinding FontWeight}"
                                    HorizontalAlignment="Stretch"
                                    VerticalAlignment="Stretch"
                                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                    Padding="{TemplateBinding Padding}"
                                    IsTabStop="False"/>

                            <Button x:Name="SecondaryButton"
                                    Grid.Column="1"
                                    Foreground="{DynamicResource AppBarButtonForeground}"
                                    Background="{TemplateBinding Background}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    BorderBrush="Transparent"
                                    HorizontalContentAlignment="Stretch"
                                    VerticalContentAlignment="Stretch"
                                    HorizontalAlignment="Stretch"
                                    VerticalAlignment="Stretch"
                                    Padding="2,0,7,0"
                                    IsTabStop="False">
                                <Button.Content>
                                    <ui:FontIconFallback
                                        FontFamily="{DynamicResource SymbolThemeFontFamily}"
                                        FontSize="8"
                                        Data="{StaticResource ChevronDownSmall}"
                                        VerticalAlignment="Center"
                                        Padding="2,2,2,0"
                                        HorizontalAlignment="Left"/>
                                </Button.Content>
                            </Button>
                        </Grid>
                    </Border>

                    <ControlTemplate.Triggers>
                        <!-- FlyoutOpen -->
                        <Trigger SourceName="CommonStatesListener" Property="CurrentStateName" Value="FlyoutOpen">
                            <Setter TargetName="PrimaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarButtonBackgroundPressed}" />
                            <Setter TargetName="SecondaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarButtonBackgroundPressed}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource AppBarButtonBorderBrushPressed}" />
                            <Setter TargetName="PrimaryButton" Property="Foreground" Value="{DynamicResource AppBarButtonForegroundPressed}" />
                            <Setter TargetName="SecondaryButton" Property="Foreground" Value="{DynamicResource AppBarButtonForegroundPressed}" />
                        </Trigger>
                        <!-- TouchPressed -->
                        <Trigger SourceName="CommonStatesListener" Property="CurrentStateName" Value="TouchPressed">
                            <Setter TargetName="PrimaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarButtonBackgroundPressed}" />
                            <Setter TargetName="SecondaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarButtonBackgroundPressed}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource AppBarButtonBorderBrushPressed}" />
                            <Setter TargetName="PrimaryButton" Property="Foreground" Value="{DynamicResource AppBarButtonForegroundPressed}" />
                            <Setter TargetName="SecondaryButton" Property="Foreground" Value="{DynamicResource AppBarButtonForegroundPressed}" />
                        </Trigger>
                        <!-- PrimaryPointerOver -->
                        <Trigger SourceName="CommonStatesListener" Property="CurrentStateName" Value="PrimaryPointerOver">
                            <Setter TargetName="PrimaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarButtonBackgroundPointerOver}" />
                            <Setter TargetName="SecondaryBackgroundGrid" Property="Background" Value="{DynamicResource SplitButtonInAppBarUnfocusedPointerOver}" />
                            <Setter TargetName="PrimaryButton" Property="Foreground" Value="{DynamicResource AppBarButtonForegroundPointerOver}" />
                        </Trigger>
                        <!-- PrimaryPressed -->
                        <Trigger SourceName="CommonStatesListener" Property="CurrentStateName" Value="PrimaryPressed">
                            <Setter TargetName="PrimaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarButtonBackgroundPressed}" />
                            <Setter TargetName="SecondaryBackgroundGrid" Property="Background" Value="{DynamicResource SplitButtonInAppBarUnfocusedPointerOver}" />
                            <Setter TargetName="PrimaryButton" Property="Foreground" Value="{DynamicResource AppBarButtonForegroundPressed}" />
                        </Trigger>
                        <!-- SecondaryPointerOver -->
                        <Trigger SourceName="CommonStatesListener" Property="CurrentStateName" Value="SecondaryPointerOver">
                            <Setter TargetName="PrimaryBackgroundGrid" Property="Background" Value="{DynamicResource SplitButtonInAppBarUnfocusedPointerOver}" />
                            <Setter TargetName="SecondaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarButtonBackgroundPointerOver}" />
                            <Setter TargetName="SecondaryButton" Property="Foreground" Value="{DynamicResource AppBarButtonForeground}" />
                        </Trigger>
                        <!-- SecondaryPressed -->
                        <Trigger SourceName="CommonStatesListener" Property="CurrentStateName" Value="SecondaryPressed">
                            <Setter TargetName="PrimaryBackgroundGrid" Property="Background" Value="{DynamicResource SplitButtonInAppBarUnfocusedPointerOver}" />
                            <Setter TargetName="SecondaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarButtonBackgroundPressed}" />
                            <Setter TargetName="SecondaryButton" Property="Foreground" Value="{DynamicResource AppBarButtonForegroundPressed}" />
                        </Trigger>
                        <!-- Checked -->
                        <Trigger SourceName="CommonStatesListener" Property="CurrentStateName" Value="Checked">
                            <Setter TargetName="PrimaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarToggleButtonBackgroundChecked}" />
                            <Setter TargetName="SecondaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarToggleButtonBackgroundChecked}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource AppBarToggleButtonBorderBrushChecked}" />
                            <Setter TargetName="PrimaryButton" Property="Foreground" Value="{DynamicResource AppBarToggleButtonForegroundChecked}" />
                            <Setter TargetName="SecondaryButton" Property="Foreground" Value="{DynamicResource AppBarToggleButtonForegroundChecked}" />
                        </Trigger>
                        <!-- CheckedFlyoutOpen -->
                        <Trigger SourceName="CommonStatesListener" Property="CurrentStateName" Value="CheckedFlyoutOpen">
                            <Setter TargetName="PrimaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarToggleButtonBackgroundCheckedPressed}" />
                            <Setter TargetName="SecondaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarToggleButtonBackgroundCheckedPressed}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource AppBarToggleButtonBorderBrushCheckedPressed}" />
                            <Setter TargetName="PrimaryButton" Property="Foreground" Value="{DynamicResource AppBarToggleButtonForegroundCheckedPressed}" />
                            <Setter TargetName="SecondaryButton" Property="Foreground" Value="{DynamicResource AppBarToggleButtonForegroundCheckedPressed}" />
                        </Trigger>
                        <!-- CheckedTouchPressed -->
                        <Trigger SourceName="CommonStatesListener" Property="CurrentStateName" Value="CheckedTouchPressed">
                            <Setter TargetName="PrimaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarToggleButtonBackgroundCheckedPressed}" />
                            <Setter TargetName="SecondaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarToggleButtonBackgroundCheckedPressed}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource AppBarToggleButtonBorderBrushCheckedPressed}" />
                            <Setter TargetName="PrimaryButton" Property="Foreground" Value="{DynamicResource AppBarToggleButtonForegroundCheckedPressed}" />
                            <Setter TargetName="SecondaryButton" Property="Foreground" Value="{DynamicResource AppBarToggleButtonForegroundCheckedPressed}" />
                        </Trigger>
                        <!-- CheckedPrimaryPointerOver -->
                        <Trigger SourceName="CommonStatesListener" Property="CurrentStateName" Value="CheckedPrimaryPointerOver">
                            <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource AppBarToggleButtonBorderBrushChecked}" />
                            <Setter TargetName="PrimaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarToggleButtonBackgroundCheckedPointerOver}" />
                            <Setter TargetName="PrimaryButton" Property="Foreground" Value="{DynamicResource AppBarToggleButtonForegroundCheckedPointerOver}" />
                            <Setter TargetName="SecondaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarToggleButtonBackgroundChecked}" />
                            <Setter TargetName="SecondaryButton" Property="Foreground" Value="{DynamicResource AppBarToggleButtonForegroundChecked}" />
                        </Trigger>
                        <!-- CheckedPrimaryPressed -->
                        <Trigger SourceName="CommonStatesListener" Property="CurrentStateName" Value="CheckedPrimaryPressed">
                            <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource AppBarToggleButtonBorderBrushChecked}" />
                            <Setter TargetName="PrimaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarToggleButtonBackgroundCheckedPressed}" />
                            <Setter TargetName="PrimaryButton" Property="Foreground" Value="{DynamicResource AppBarToggleButtonForegroundCheckedPressed}" />
                            <Setter TargetName="SecondaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarToggleButtonBackgroundChecked}" />
                            <Setter TargetName="SecondaryButton" Property="Foreground" Value="{DynamicResource AppBarToggleButtonForegroundChecked}" />
                        </Trigger>
                        <!-- CheckedSecondaryPointerOver -->
                        <Trigger SourceName="CommonStatesListener" Property="CurrentStateName" Value="CheckedSecondaryPointerOver">
                            <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource AppBarToggleButtonBorderBrushChecked}" />
                            <Setter TargetName="PrimaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarToggleButtonBackgroundChecked}" />
                            <Setter TargetName="PrimaryButton" Property="Foreground" Value="{DynamicResource AppBarToggleButtonForegroundChecked}" />
                            <Setter TargetName="SecondaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarToggleButtonBackgroundCheckedPointerOver}" />
                            <Setter TargetName="SecondaryButton" Property="Foreground" Value="{DynamicResource AppBarToggleButtonForegroundCheckedPointerOver}" />
                        </Trigger>
                        <!-- CheckedSecondaryPressed -->
                        <Trigger SourceName="CommonStatesListener" Property="CurrentStateName" Value="CheckedSecondaryPressed">
                            <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource AppBarToggleButtonBorderBrushChecked}" />
                            <Setter TargetName="PrimaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarToggleButtonBackgroundChecked}" />
                            <Setter TargetName="PrimaryButton" Property="Foreground" Value="{DynamicResource AppBarToggleButtonForegroundChecked}" />
                            <Setter TargetName="SecondaryBackgroundGrid" Property="Background" Value="{DynamicResource AppBarToggleButtonBackgroundCheckedPressed}" />
                            <Setter TargetName="SecondaryButton" Property="Foreground" Value="{DynamicResource AppBarToggleButtonForegroundCheckedPressed}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="primitives:CommandBarToolBar">
        <Setter Property="Background" Value="{DynamicResource CommandBarBackground}" />
        <Setter Property="Foreground" Value="{DynamicResource CommandBarForeground}" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="primitives:CommandBarToolBar">
                    <ControlTemplate.Resources>
                        <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>
                    </ControlTemplate.Resources>
                    <Grid
                        x:Name="LayoutRoot"
                        SnapsToDevicePixels="True">
                        <Grid.Resources>
                            <Style TargetType="local:SplitButton" BasedOn="{StaticResource SplitButtonCommandBarStyle}"/>
                            <Style TargetType="local:ToggleSplitButton" BasedOn="{StaticResource SplitButtonCommandBarStyle}"/>
                        </Grid.Resources>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="AvailableCommandsStates">
                                <VisualState x:Name="BothCommands" />
                                <VisualState x:Name="PrimaryCommandsOnly">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OverflowContentRoot" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="SecondaryCommandsOnly">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_ToolBarPanel" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid
                            x:Name="ContentRoot"
                            VerticalAlignment="Top"
                            Height="{TemplateBinding Height}"
                            MinHeight="{DynamicResource AppBarThemeCompactHeight}"
                            Background="{TemplateBinding Background}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" MinWidth="{DynamicResource AppBarMoreButtonColumnMinWidth}"/>
                            </Grid.ColumnDefinitions>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition x:Name="ContentControlColumnDefinition" Width="*" />
                                    <ColumnDefinition x:Name="PrimaryItemsControlColumnDefinition" Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <!--
                                Use a ContentControl rather than a ContentPresenter so that IsEnabled can be set to false
                                in the Minimal/HiddenClosed states to remove it from being a tab-stop candidate.
                                -->
                                <ContentControl
                                    x:Name="ContentControl"
                                    Margin="{TemplateBinding Padding}"
                                    Content="{TemplateBinding Header}"
                                    ContentTemplate="{TemplateBinding HeaderTemplate}"
                                    Foreground="{TemplateBinding Foreground}"
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                    IsTabStop="False"
                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                                <primitives:CommandBarPanel
                                    x:Name="PART_ToolBarPanel"
                                    HorizontalAlignment="Right"
                                    MinHeight="{DynamicResource AppBarThemeCompactHeight}"
                                    Grid.Column="1"
                                    IsItemsHost="true"
                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                            </Grid>
                            <ToggleButton
                                x:Name="MoreButton"
                                IsEnabled="{TemplateBinding HasOverflowItems}"
                                Foreground="{TemplateBinding Foreground}"
                                Style="{DynamicResource EllipsisButton}"
                                Padding="{DynamicResource CommandBarMoreButtonMargin}"
                                MinHeight="{DynamicResource AppBarThemeCompactHeight}"
                                VerticalAlignment="Top"
                                Grid.Column="1"
                                Visibility="{TemplateBinding EffectiveOverflowButtonVisibility}"
                                IsChecked="{Binding Path=IsOverflowOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                                ClickMode="Press">
                                <ui:FontIconFallback
                                    x:Name="EllipsisIcon"
                                    VerticalAlignment="Center"
                                    FontFamily="{DynamicResource SymbolThemeFontFamily}"
                                    FontSize="20"
                                    Data="{StaticResource More}"
                                    Height="{DynamicResource AppBarExpandButtonCircleDiameter}" />
                            </ToggleButton>
                            <ui:MenuPopup
                                x:Name="OverflowPopup"
                                AllowsTransparency="true"
                                Placement="Custom"
                                IsOpen="{Binding Path=IsOverflowOpen, RelativeSource={RelativeSource TemplatedParent}}"
                                StaysOpen="True"
                                Focusable="false"
                                PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}">
                                <ui:ThemeShadowChrome
                                    x:Name="OverflowContentRoot"
                                    IsShadowEnabled="{DynamicResource {x:Static SystemParameters.DropShadowKey}}"
                                    CornerRadius="{Binding ElementName=SecondaryItemsControl, Path=CornerRadius}"
                                    MinWidth="{DynamicResource CommandBarOverflowMinWidth}"
                                    MaxWidth="{DynamicResource CommandBarOverflowMaxWidth}"
                                    MaxHeight="{TemplateBinding OverflowContentMaxHeight}"
                                    RenderOptions.ClearTypeHint="Enabled">

                                    <primitives:CommandBarOverflowPresenter
                                        x:Name="SecondaryItemsControl"
                                        Style="{TemplateBinding OverflowPresenterStyle}"
                                        IsTabStop="False">
                                        <primitives:CommandBarOverflowPresenter.Resources>
                                            <Style TargetType="local:AppBarButton" BasedOn="{StaticResource AppBarButtonOverflowStyle}" />
                                            <Style TargetType="local:AppBarToggleButton" BasedOn="{StaticResource AppBarToggleButtonOverflowStyle}" />
                                        </primitives:CommandBarOverflowPresenter.Resources>
                                        <primitives:CommandBarOverflowPanel
                                            x:Name="PART_ToolBarOverflowPanel"
                                            Focusable="true"
                                            FocusVisualStyle="{x:Null}"
                                            KeyboardNavigation.TabNavigation="Once"
                                            KeyboardNavigation.DirectionalNavigation="Cycle"
                                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                                    </primitives:CommandBarOverflowPresenter>
                                </ui:ThemeShadowChrome>
                            </ui:MenuPopup>
                            <Rectangle
                                x:Name="HighContrastBorder"
                                Grid.ColumnSpan="2"
                                Visibility="Collapsed"
                                VerticalAlignment="Stretch"
                                Stroke="{DynamicResource CommandBarHighContrastBorder}"
                                StrokeThickness="1" />
                            <Border x:Name="OpenBorder"
                                    Grid.ColumnSpan="2"
                                    Visibility="Collapsed"
                                    VerticalAlignment="Stretch"
                                    BorderThickness="{DynamicResource CommandBarBorderThicknessOpen}"
                                    BorderBrush="{DynamicResource CommandBarBorderBrushOpen}"
                                    CornerRadius="{TemplateBinding CornerRadius}" />
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <!-- Disabled -->
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="EllipsisIcon" Property="Foreground" Value="{DynamicResource CommandBarEllipsisIconForegroundDisabled}" />
                        </Trigger>
                        <Trigger Property="DefaultLabelPosition" Value="Bottom">
                            <Setter TargetName="MoreButton" Property="VerticalAlignment" Value="Stretch" />
                        </Trigger>
                        <!-- DynamicOverflowEnabled -->
                        <Trigger Property="IsDynamicOverflowEnabled" Value="True">
                            <Setter TargetName="ContentControlColumnDefinition" Property="Width" Value="Auto" />
                            <Setter TargetName="PrimaryItemsControlColumnDefinition" Property="Width" Value="*" />
                        </Trigger>
                        <Trigger Property="IsOverflowOpen" Value="True">
                            <Setter TargetName="OpenBorder" Property="Visibility" Value="Visible" />
                        </Trigger>
                        <Trigger SourceName="OverflowPopup" Property="IsSuspendingAnimation" Value="true">
                            <Setter TargetName="OverflowPopup" Property="PopupAnimation" Value="None" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="primitives:CommandBarOverflowPresenter">
        <Setter Property="Background" Value="{DynamicResource CommandBarOverflowPresenterBackground}" />
        <Setter Property="BorderBrush" Value="{DynamicResource CommandBarOverflowPresenterBorderBrush}" />
        <Setter Property="Padding" Value="{DynamicResource CommandBarOverflowPresenterBorderPadding}" />
        <Setter Property="MaxWidth" Value="{DynamicResource CommandBarOverflowMaxWidth}" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
        <Setter Property="KeyboardNavigation.TabNavigation" Value="Once" />
        <Setter Property="CornerRadius" Value="{DynamicResource OverlayCornerRadius}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="primitives:CommandBarOverflowPresenter">
                    <Border
                        x:Name="LayoutRoot"
                        Background="{TemplateBinding Background}"
                        CornerRadius="{TemplateBinding CornerRadius}"
                        SnapsToDevicePixels="True">
                        <!--<VisualStateManager.VisualStateGroups>
                        <VisualStateGroup x:Name="DisplayModeStates">
                        <VisualState x:Name="DisplayModeDefault" />
                        <VisualState x:Name="FullWidthOpenDown" />
                        <VisualState x:Name="FullWidthOpenUp" />
                        </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>-->
                        <Border
                            Padding="{TemplateBinding Padding}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{DynamicResource CommandBarOverflowPresenterBorderThickness}"
                            CornerRadius="{TemplateBinding CornerRadius}">
                            <ScrollViewer
                                Content="{TemplateBinding Content}"
                                HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
                                VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
                                Padding="3"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </Border>
                    </Border>
                    <ControlTemplate.Triggers>
                        <!-- FullWidthOpenDown -->
                        <!--<Trigger SourceName="DisplayModeStatesListener" Property="CurrentStateName" Value="FullWidthOpenDown">
                        <Setter TargetName="LayoutRoot" Property="Padding" Value="{DynamicResource CommandBarOverflowPresenterBorderDownPadding}" />
                        <Setter TargetName="LayoutRoot" Property="BorderThickness" Value="{DynamicResource CommandBarOverflowPresenterBorderDownThickness}" />
                        </Trigger>-->
                        <!-- FullWidthOpenUp -->
                        <!--<Trigger SourceName="DisplayModeStatesListener" Property="CurrentStateName" Value="FullWidthOpenUp">
                        <Setter TargetName="LayoutRoot" Property="Padding" Value="{DynamicResource CommandBarOverflowPresenterBorderUpPadding}" />
                        <Setter TargetName="LayoutRoot" Property="BorderThickness" Value="{DynamicResource CommandBarOverflowPresenterBorderUpThickness}" />
                        </Trigger>-->
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:CommandBar">
        <Setter Property="Background" Value="{DynamicResource CommandBarBackground}" />
        <Setter Property="Foreground" Value="{DynamicResource CommandBarForeground}" />
        <Setter Property="Padding" Value="4,0,0,0" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:CommandBar">
                    <primitives:CommandBarToolBar
                        x:Name="PART_ToolBar"
                        Background="{TemplateBinding Background}"
                        Foreground="{TemplateBinding Foreground}"
                        IsTabStop="{TemplateBinding IsTabStop}"
                        VerticalAlignment="{TemplateBinding VerticalAlignment}"
                        HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                        HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                        Header="{TemplateBinding Content}"
                        HeaderTemplate="{TemplateBinding ContentTemplate}"
                        DefaultLabelPosition="{TemplateBinding DefaultLabelPosition}"
                        IsDynamicOverflowEnabled="{TemplateBinding IsDynamicOverflowEnabled}"
                        OverflowButtonVisibility="{TemplateBinding OverflowButtonVisibility}"
                        OverflowPresenterStyle="{TemplateBinding CommandBarOverflowPresenterStyle}"
                        IsOverflowOpen="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>