<!--
    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:local="using:Microsoft.Terminal.Settings.Editor"
                    xmlns:mtu="using:Microsoft.Terminal.UI"
                    xmlns:muxc="using:Microsoft.UI.Xaml.Controls">

    <!--  Merge SettingContainerStyle here to give every page access to the SettingContainer  -->
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="SettingContainerStyle.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <ResourceDictionary.ThemeDictionaries>
        <ResourceDictionary x:Key="Dark">
            <SolidColorBrush x:Key="DeleteButtonBackground"
                             Color="{ThemeResource DeleteButtonColor}" />
            <SolidColorBrush x:Key="DeleteButtonBackgroundPointerOver"
                             Opacity="0.9"
                             Color="{ThemeResource DeleteButtonColor}" />
            <SolidColorBrush x:Key="DeleteButtonBackgroundPressed"
                             Opacity="0.8"
                             Color="{ThemeResource DeleteButtonColor}" />
            <SolidColorBrush x:Key="DeleteButtonForeground"
                             Color="#FFFFFF" />
            <SolidColorBrush x:Key="DeleteButtonForegroundPointerOver"
                             Color="#FFFFFF" />
            <SolidColorBrush x:Key="DeleteButtonForegroundPressed"
                             Color="#B3FFFFFF" />
        </ResourceDictionary>
        <ResourceDictionary x:Key="Light">
            <SolidColorBrush x:Key="DeleteButtonBackground"
                             Color="{ThemeResource DeleteButtonColor}" />
            <SolidColorBrush x:Key="DeleteButtonBackgroundPointerOver"
                             Opacity="0.9"
                             Color="{ThemeResource DeleteButtonColor}" />
            <SolidColorBrush x:Key="DeleteButtonBackgroundPressed"
                             Opacity="0.8"
                             Color="{ThemeResource DeleteButtonColor}" />
            <SolidColorBrush x:Key="DeleteButtonForeground"
                             Color="#FFFFFF" />
            <SolidColorBrush x:Key="DeleteButtonForegroundPointerOver"
                             Color="#FFFFFF" />
            <SolidColorBrush x:Key="DeleteButtonForegroundPressed"
                             Color="#B3FFFFFF" />
        </ResourceDictionary>
        <ResourceDictionary x:Key="HighContrast">
            <SolidColorBrush x:Key="DeleteButtonBackground"
                             Color="{ThemeResource SystemColorButtonFaceColor}" />
            <SolidColorBrush x:Key="DeleteButtonBackgroundPointerOver"
                             Color="{ThemeResource SystemColorHighlightColor}" />
            <SolidColorBrush x:Key="DeleteButtonBackgroundPressed"
                             Color="{ThemeResource SystemColorHighlightColor}" />
            <SolidColorBrush x:Key="DeleteButtonForeground"
                             Color="{ThemeResource SystemColorButtonTextColor}" />
            <SolidColorBrush x:Key="DeleteButtonForegroundPointerOver"
                             Color="{ThemeResource SystemColorHighlightTextColor}" />
            <SolidColorBrush x:Key="DeleteButtonForegroundPressed"
                             Color="{ThemeResource SystemColorHighlightTextColor}" />
        </ResourceDictionary>
    </ResourceDictionary.ThemeDictionaries>

    <local:ColorToBrushConverter x:Key="ColorToBrushConverter" />
    <local:ColorToStringConverter x:Key="ColorToStringConverter" />

    <Color x:Key="DeleteButtonColor">Firebrick</Color>

    <x:Double x:Key="StandardIconSize">14.0</x:Double>
    <Thickness x:Key="StandardControlMargin">0,24,0,0</Thickness>
    <x:Double x:Key="StandardBoxMinWidth">248</x:Double>
    <x:Double x:Key="StandardControlMaxWidth">1000</x:Double>
    <Thickness x:Key="SettingStackMargin">0,0,0,0</Thickness>

    <!-- We're purposefully not providing a DataType here.
     This is expected to be used with an IReference<Microsoft::Terminal::Core::Color>.
     We're doing all the data type handling in the used converters.-->
    <DataTemplate x:Key="ColorPreviewTemplate">
        <Grid ColumnSpacing="4">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Rectangle Grid.Column="0"
                       Width="12"
                       Height="12"
                       VerticalAlignment="Center"
                       Fill="{Binding Converter={StaticResource ColorToBrushConverter}}"
                       RadiusX="2"
                       RadiusY="2" />
            <TextBlock Grid.Column="1"
                       Margin="0,0,0,0"
                       HorizontalAlignment="Right"
                       VerticalAlignment="Center"
                       FontFamily="Segoe UI, Segoe Fluent Icons, Segoe MDL2 Assets"
                       Style="{StaticResource SettingsPageItemDescriptionStyle}"
                       Text="{Binding Converter={StaticResource ColorToStringConverter}}" />
        </Grid>
    </DataTemplate>

    <!--
        This is for styling the entire items control used on the
        color schemes page
    -->
    <Style x:Key="ItemsControlStyle"
           TargetType="ItemsControl">
        <Setter Property="Margin" Value="{StaticResource StandardControlMargin}" />
    </Style>

    <!--  Used to stack a group of settings  -->
    <Style x:Key="SettingsStackStyle"
           TargetType="StackPanel">
        <Setter Property="MaxWidth" Value="{StaticResource StandardControlMaxWidth}" />
    </Style>

    <!--  Used to stack a group of settings inside a pivot  -->
    <Style x:Key="PivotStackStyle"
           TargetType="StackPanel">
        <Setter Property="MaxWidth" Value="{StaticResource StandardControlMaxWidth}" />
    </Style>

    <!--  Combo Box  -->
    <Style x:Key="ComboBoxSettingStyle"
           BasedOn="{StaticResource DefaultComboBoxStyle}"
           TargetType="ComboBox">
        <Setter Property="MinWidth" Value="{StaticResource StandardBoxMinWidth}" />
    </Style>

    <!--  Text Box  -->
    <Style x:Key="TextBoxSettingStyle"
           BasedOn="{StaticResource DefaultTextBoxStyle}"
           TargetType="TextBox">
        <Setter Property="ContextFlyout">
            <Setter.Value>
                <mtu:TextMenuFlyout />
            </Setter.Value>
        </Setter>
        <Setter Property="MinWidth" Value="{StaticResource StandardBoxMinWidth}" />
        <Setter Property="MaxWidth" Value="400" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="TextWrapping" Value="Wrap" />
    </Style>

    <!--  Text Block  -->
    <Style x:Key="TextBlockSettingStyle"
           BasedOn="{StaticResource BodyTextBlockStyle}"
           TargetType="TextBlock">
        <Setter Property="MinWidth" Value="{StaticResource StandardBoxMinWidth}" />
        <Setter Property="MaxWidth" Value="400" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="TextWrapping" Value="Wrap" />
    </Style>

    <Style x:Key="TextBlockSubHeaderStyle"
           BasedOn="{StaticResource BodyStrongTextBlockStyle}"
           TargetType="TextBlock">
        <Setter Property="MaxWidth" Value="{StaticResource StandardControlMaxWidth}" />
        <Setter Property="Margin" Value="0,32,0,4" />
    </Style>

    <Style x:Key="TextBlockSubtitleStyle"
           BasedOn="{StaticResource SubtitleTextBlockStyle}"
           TargetType="TextBlock">
        <Setter Property="MaxWidth" Value="{StaticResource StandardControlMaxWidth}" />
        <Setter Property="Margin" Value="0,32,0,4" />
    </Style>

    <!--  Used for disclaimers  -->
    <Style x:Key="DisclaimerStyle"
           TargetType="TextBlock">
        <Setter Property="TextWrapping" Value="Wrap" />
        <Setter Property="MaxWidth" Value="{StaticResource StandardControlMaxWidth}" />
        <Setter Property="Foreground" Value="{ThemeResource TextFillColorSecondaryBrush}" />
        <Setter Property="Margin" Value="0,0,0,8" />
    </Style>

    <!--  Used for flyout messages  -->
    <Style x:Key="CustomFlyoutTextStyle"
           BasedOn="{StaticResource BaseTextBlockStyle}"
           TargetType="TextBlock">
        <Setter Property="FontWeight" Value="SemiBold" />
        <Setter Property="Margin" Value="0,0,0,8" />
        <Setter Property="TextWrapping" Value="Wrap" />
    </Style>

    <!--  Used for the flyout itself. Removes scroll bar to allow for text wrapping.  -->
    <Style x:Key="CustomFlyoutPresenterStyle"
           TargetType="FlyoutPresenter">
        <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
    </Style>

    <!--  Number Box  -->
    <Style x:Key="NumberBoxSettingStyle"
           TargetType="muxc:NumberBox">
        <Setter Property="SpinButtonPlacementMode" Value="Compact" />
        <Setter Property="HorizontalAlignment" Value="Left" />
    </Style>

    <!--  Button-Related Styling  -->
    <Style x:Key="BaseButtonStyle"
           BasedOn="{StaticResource DefaultButtonStyle}"
           TargetType="Button">
        <Setter Property="VerticalAlignment" Value="Center" />
    </Style>

    <Style x:Key="BrowseButtonStyle"
           BasedOn="{StaticResource BaseButtonStyle}"
           TargetType="Button">
        <Setter Property="Margin" Value="8,0,0,0" />
        <Setter Property="MinHeight" Value="32" />
    </Style>

    <!--  Delete button based on Accent button template  -->
    <Style x:Key="DeleteButtonStyle"
           TargetType="Button">
        <Setter Property="Foreground" Value="{ThemeResource DeleteButtonForeground}" />
        <Setter Property="Background" Value="{ThemeResource DeleteButtonBackground}" />
        <Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
        <Setter Property="BorderBrush" Value="{ThemeResource AccentButtonBorderBrush}" />
        <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <ContentPresenter x:Name="ContentPresenter"
                                      Padding="{TemplateBinding Padding}"
                                      HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                      VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                      AutomationProperties.AccessibilityView="Raw"
                                      Background="{TemplateBinding Background}"
                                      BackgroundSizing="{TemplateBinding BackgroundSizing}"
                                      BorderBrush="{TemplateBinding BorderBrush}"
                                      BorderThickness="{TemplateBinding BorderThickness}"
                                      Content="{TemplateBinding Content}"
                                      ContentTemplate="{TemplateBinding ContentTemplate}"
                                      ContentTransitions="{TemplateBinding ContentTransitions}"
                                      CornerRadius="{TemplateBinding CornerRadius}"
                                      Foreground="{TemplateBinding Foreground}">
                        <ContentPresenter.BackgroundTransition>
                            <BrushTransition Duration="0:0:0.083" />
                        </ContentPresenter.BackgroundTransition>

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource DeleteButtonBackgroundPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource AccentButtonBorderBrushPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource DeleteButtonForegroundPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource DeleteButtonBackgroundPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource AccentButtonBorderBrushPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource DeleteButtonForegroundPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource AccentButtonBackgroundDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource AccentButtonBorderBrushDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource AccentButtonForegroundDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </ContentPresenter>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ExtraSmallButtonStyle"
           BasedOn="{StaticResource BrowseButtonStyle}"
           TargetType="Button">
        <Setter Property="Height" Value="24" />
        <Setter Property="Width" Value="24" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="MinHeight" Value="0" />
        <Setter Property="MinWidth" Value="0" />
    </Style>

    <Style x:Key="SmallButtonStyle"
           BasedOn="{StaticResource BrowseButtonStyle}"
           TargetType="Button">
        <Setter Property="Height" Value="32" />
        <Setter Property="Width" Value="32" />
        <Setter Property="Padding" Value="4" />
    </Style>

    <Style x:Key="AccentBrowseButtonStyle"
           BasedOn="{StaticResource AccentButtonStyle}"
           TargetType="Button">
        <Setter Property="Margin" Value="8,0,0,0" />
        <Setter Property="VerticalAlignment" Value="Bottom" />
    </Style>

    <Style x:Key="AccentSmallButtonStyle"
           BasedOn="{StaticResource AccentButtonStyle}"
           TargetType="Button">
        <Setter Property="Margin" Value="8,0,0,0" />
        <Setter Property="VerticalAlignment" Value="Bottom" />
        <Setter Property="Height" Value="32" />
        <Setter Property="Width" Value="32" />
        <Setter Property="Padding" Value="5" />
    </Style>

    <Style x:Key="DeleteSmallButtonStyle"
           BasedOn="{StaticResource DeleteButtonStyle}"
           TargetType="Button">
        <Setter Property="Height" Value="32" />
        <Setter Property="Width" Value="32" />
        <Setter Property="Padding" Value="5" />
    </Style>

    <Style x:Key="DeleteExtraSmallButtonStyle"
           BasedOn="{StaticResource DeleteButtonStyle}"
           TargetType="Button">
        <Setter Property="Height" Value="24" />
        <Setter Property="Width" Value="24" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="MinHeight" Value="0" />
        <Setter Property="MinWidth" Value="0" />
    </Style>

    <Style x:Key="IconButtonTextBlockStyle"
           TargetType="TextBlock">
        <Setter Property="Margin" Value="8,0,0,0" />
    </Style>

    <Style x:Key="BIAlignmentToggleButtonStyle"
           TargetType="ToggleButton">
        <Setter Property="Width" Value="40" />
        <Setter Property="Height" Value="40" />
        <Setter Property="Padding" Value="8" />
    </Style>

    <Style x:Key="ColorButtonStyle"
           TargetType="Button">
        <Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
        <Setter Property="BorderBrush" Value="{ThemeResource ButtonBorderBrush}" />
        <Setter Property="BorderThickness" Value="{ThemeResource ButtonBorderThemeThickness}" />
        <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
        <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
        <Setter Property="FocusVisualMargin" Value="-3" />
        <Setter Property="Width" Value="32" />
        <Setter Property="Height" Value="32" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Border x:Name="ColorButtonBackground"
                                Background="{TemplateBinding Background}"
                                BackgroundSizing="{TemplateBinding BackgroundSizing}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}" />
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />

                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColorButtonBackground"
                                                                       Storyboard.TargetProperty="Opacity">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="0.9" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColorButtonBackground"
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ButtonBorderBrushPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColorButtonBackground"
                                                                       Storyboard.TargetProperty="Opacity">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="0.8" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColorButtonBackground"
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ButtonBorderBrushPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColorButtonBackground"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ButtonBackgroundDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColorButtonBackground"
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ButtonBorderBrushDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ColorToggleButtonStyle"
           TargetType="ToggleButton">
        <Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
        <Setter Property="BorderBrush" Value="{ThemeResource ToggleButtonBorderThemeBrush}" />
        <Setter Property="BorderThickness" Value="{ThemeResource ToggleButtonBorderThemeThickness}" />
        <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
        <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
        <Setter Property="FocusVisualMargin" Value="-3" />
        <Setter Property="Width" Value="32" />
        <Setter Property="Height" Value="32" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid>
                        <Border x:Name="ColorButtonBorder"
                                BorderBrush="{TemplateBinding Background}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{TemplateBinding CornerRadius}">
                            <Grid>
                                <Border x:Name="ColorButtonBackground"
                                        Background="{TemplateBinding Background}"
                                        BorderThickness="0" />
                                <!--  We have to use Binding here! We're trying to do a template binding with a converter, so we have to use the verbose syntax.  -->
                                <FontIcon Margin="0,0,-1,-1"
                                          HorizontalAlignment="Right"
                                          VerticalAlignment="Bottom"
                                          FontFamily="Segoe Fluent Icons, Segoe MDL2 Assets"
                                          FontSize="12"
                                          Foreground="{TemplateBinding BorderBrush}"
                                          Glyph="&#xE73D;"
                                          Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsChecked, Mode=OneWay}" />
                            </Grid>
                        </Border>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled" />

                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColorButtonBackground"
                                                                       Storyboard.TargetProperty="Opacity">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="0.7" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColorButtonBorder"
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{Binding Path=BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColorButtonBackground"
                                                                       Storyboard.TargetProperty="Opacity">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="0.5" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColorButtonBorder"
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{Binding Path=BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ColorButtonBorder"
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{Binding Path=BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  Slider-Related Styling  -->
    <Style x:Key="SliderValueLabelStyle"
           TargetType="TextBlock">
        <Setter Property="Width" Value="35" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Margin" Value="5,0,0,0" />
    </Style>

    <Style x:Key="CustomSliderControlGridStyle"
           TargetType="Grid">
        <Setter Property="Width" Value="{StaticResource StandardBoxMinWidth}" />
        <Setter Property="HorizontalAlignment" Value="Left" />
    </Style>

    <Style x:Key="ToggleSwitchInExpanderStyle"
           TargetType="ToggleSwitch">
        <Setter Property="Foreground" Value="{ThemeResource ToggleSwitchContentForeground}" />
        <Setter Property="HorizontalAlignment" Value="Right" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="HorizontalContentAlignment" Value="Right" />
        <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
        <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
        <Setter Property="ManipulationMode" Value="System,TranslateX" />
        <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
        <Setter Property="MinWidth" Value="{StaticResource ToggleSwitchThemeMinWidth}" />
        <Setter Property="FocusVisualMargin" Value="-7,-3,-7,-3" />
        <Setter Property="Margin" Value="0,0,10,0" />
        <Setter Property="MinWidth" Value="0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleSwitch">
                    <Grid Background="{TemplateBinding Background}"
                          BorderBrush="{TemplateBinding BorderBrush}"
                          BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>

                        <ContentPresenter x:Name="HeaderContentPresenter"
                                          Grid.Row="0"
                                          Margin="{ThemeResource ToggleSwitchTopHeaderMargin}"
                                          VerticalAlignment="Top"
                                          x:DeferLoadStrategy="Lazy"
                                          AutomationProperties.AccessibilityView="Raw"
                                          Content="{TemplateBinding Header}"
                                          ContentTemplate="{TemplateBinding HeaderTemplate}"
                                          Foreground="{ThemeResource ToggleSwitchHeaderForeground}"
                                          IsHitTestVisible="False"
                                          TextWrapping="Wrap"
                                          Visibility="Collapsed" />
                        <Grid Grid.Row="1"
                              HorizontalAlignment="Left"
                              VerticalAlignment="Top">

                            <Grid.RowDefinitions>
                                <RowDefinition Height="{ThemeResource ToggleSwitchPreContentMargin}" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="{ThemeResource ToggleSwitchPostContentMargin}" />
                            </Grid.RowDefinitions>

                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="12"
                                                  MaxWidth="12" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid x:Name="SwitchAreaGrid"
                                  Grid.RowSpan="3"
                                  Grid.ColumnSpan="3"
                                  Margin="0,5"
                                  Background="{ThemeResource ToggleSwitchContainerBackground}"
                                  Control.IsTemplateFocusTarget="True" />
                            <ContentPresenter x:Name="OffContentPresenter"
                                              Grid.RowSpan="3"
                                              Grid.Column="0"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              AutomationProperties.AccessibilityView="Raw"
                                              Content="{TemplateBinding OffContent}"
                                              ContentTemplate="{TemplateBinding OffContentTemplate}"
                                              Foreground="{TemplateBinding Foreground}"
                                              IsHitTestVisible="False"
                                              Opacity="0" />
                            <ContentPresenter x:Name="OnContentPresenter"
                                              Grid.RowSpan="3"
                                              Grid.Column="0"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              AutomationProperties.AccessibilityView="Raw"
                                              Content="{TemplateBinding OnContent}"
                                              ContentTemplate="{TemplateBinding OnContentTemplate}"
                                              Foreground="{TemplateBinding Foreground}"
                                              IsHitTestVisible="False"
                                              Opacity="0" />
                            <Rectangle x:Name="OuterBorder"
                                       Grid.Row="1"
                                       Grid.Column="2"
                                       Width="40"
                                       Height="20"
                                       Fill="{ThemeResource ToggleSwitchFillOff}"
                                       RadiusX="10"
                                       RadiusY="10"
                                       Stroke="{ThemeResource ToggleSwitchStrokeOff}"
                                       StrokeThickness="{ThemeResource ToggleSwitchOuterBorderStrokeThickness}" />
                            <Rectangle x:Name="SwitchKnobBounds"
                                       Grid.Row="1"
                                       Grid.Column="2"
                                       Width="40"
                                       Height="20"
                                       Fill="{ThemeResource ToggleSwitchFillOn}"
                                       Opacity="0"
                                       RadiusX="10"
                                       RadiusY="10"
                                       Stroke="{ThemeResource ToggleSwitchStrokeOn}"
                                       StrokeThickness="{ThemeResource ToggleSwitchOnStrokeThickness}" />
                            <Grid x:Name="SwitchKnob"
                                  Grid.Row="1"
                                  Grid.Column="2"
                                  Width="20"
                                  Height="20"
                                  HorizontalAlignment="Left">
                                <Border x:Name="SwitchKnobOn"
                                        Width="12"
                                        Height="12"
                                        Margin="0,0,1,0"
                                        HorizontalAlignment="Center"
                                        Background="{ThemeResource ToggleSwitchKnobFillOn}"
                                        BorderBrush="{ThemeResource ToggleSwitchKnobStrokeOn}"
                                        CornerRadius="7"
                                        Opacity="0"
                                        RenderTransformOrigin="0.5, 0.5">
                                    <Border.RenderTransform>
                                        <CompositeTransform />
                                    </Border.RenderTransform>
                                </Border>
                                <Rectangle x:Name="SwitchKnobOff"
                                           Width="12"
                                           Height="12"
                                           Margin="-1,0,0,0"
                                           HorizontalAlignment="Center"
                                           Fill="{ThemeResource ToggleSwitchKnobFillOff}"
                                           RadiusX="7"
                                           RadiusY="7"
                                           RenderTransformOrigin="0.5, 0.5">
                                    <Rectangle.RenderTransform>
                                        <CompositeTransform />
                                    </Rectangle.RenderTransform>
                                </Rectangle>
                                <Grid.RenderTransform>
                                    <TranslateTransform x:Name="KnobTranslateTransform" />
                                </Grid.RenderTransform>
                            </Grid>
                            <Thumb x:Name="SwitchThumb"
                                   Grid.RowSpan="3"
                                   Grid.ColumnSpan="3"
                                   AutomationProperties.AccessibilityView="Raw">
                                <Thumb.Template>
                                    <ControlTemplate TargetType="Thumb">
                                        <Rectangle Fill="Transparent" />
                                    </ControlTemplate>
                                </Thumb.Template>
                            </Thumb>

                        </Grid>

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                       Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchStrokeOff}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchFillOff}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff"
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchKnobFillOff}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchKnobFillOn}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchFillOn}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                       Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchStrokeOn}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchContainerBackground}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames EnableDependentAnimation="True"
                                                                       Storyboard.TargetName="SwitchKnobOn"
                                                                       Storyboard.TargetProperty="Width">
                                            <SplineDoubleKeyFrame KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                                  KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                  Value="12" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames EnableDependentAnimation="True"
                                                                       Storyboard.TargetName="SwitchKnobOn"
                                                                       Storyboard.TargetProperty="Height">
                                            <SplineDoubleKeyFrame KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                                  KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                  Value="12" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames EnableDependentAnimation="True"
                                                                       Storyboard.TargetName="SwitchKnobOff"
                                                                       Storyboard.TargetProperty="Width">
                                            <SplineDoubleKeyFrame KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                                  KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                  Value="12" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames EnableDependentAnimation="True"
                                                                       Storyboard.TargetName="SwitchKnobOff"
                                                                       Storyboard.TargetProperty="Height">
                                            <SplineDoubleKeyFrame KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                                  KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                  Value="12" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                      Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)">
                                            <LinearColorKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                 Value="{ThemeResource ToggleSwitchStrokeOffPointerOver}" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                      Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                            <LinearColorKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                 Value="{ThemeResource ToggleSwitchFillOffPointerOver}" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff"
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchKnobFillOffPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchKnobFillOnPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchFillOnPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                       Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchStrokeOnPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid"
                                                                      Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
                                            <LinearColorKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                 Value="{ThemeResource ToggleSwitchContainerBackgroundPointerOver}" />
                                        </ColorAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames EnableDependentAnimation="True"
                                                                       Storyboard.TargetName="SwitchKnobOn"
                                                                       Storyboard.TargetProperty="Width">
                                            <SplineDoubleKeyFrame KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                                  KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                  Value="14" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames EnableDependentAnimation="True"
                                                                       Storyboard.TargetName="SwitchKnobOn"
                                                                       Storyboard.TargetProperty="Height">
                                            <SplineDoubleKeyFrame KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                                  KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                  Value="14" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames EnableDependentAnimation="True"
                                                                       Storyboard.TargetName="SwitchKnobOff"
                                                                       Storyboard.TargetProperty="Width">
                                            <SplineDoubleKeyFrame KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                                  KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                  Value="14" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames EnableDependentAnimation="True"
                                                                       Storyboard.TargetName="SwitchKnobOff"
                                                                       Storyboard.TargetProperty="Height">
                                            <SplineDoubleKeyFrame KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                                  KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                  Value="14" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">

                                    <VisualState.Setters>
                                        <Setter Target="SwitchKnobOn.HorizontalAlignment" Value="Right" />
                                        <Setter Target="SwitchKnobOn.Margin" Value="0,0,3,0" />
                                        <Setter Target="SwitchKnobOff.HorizontalAlignment" Value="Left" />
                                        <Setter Target="SwitchKnobOff.Margin" Value="3,0,0,0" />
                                    </VisualState.Setters>

                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                      Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)">
                                            <LinearColorKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                 Value="{ThemeResource ToggleSwitchStrokeOffPressed}" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                      Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                            <LinearColorKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                 Value="{ThemeResource ToggleSwitchFillOffPressed}" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchFillOnPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                       Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchStrokeOnPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff"
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchKnobFillOffPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchKnobFillOnPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid"
                                                                      Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
                                            <LinearColorKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                 Value="{ThemeResource ToggleSwitchContainerBackgroundPressed}" />
                                        </ColorAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames EnableDependentAnimation="True"
                                                                       Storyboard.TargetName="SwitchKnobOn"
                                                                       Storyboard.TargetProperty="Width">
                                            <SplineDoubleKeyFrame KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                                  KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                  Value="17" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames EnableDependentAnimation="True"
                                                                       Storyboard.TargetName="SwitchKnobOn"
                                                                       Storyboard.TargetProperty="Height">
                                            <SplineDoubleKeyFrame KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                                  KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                  Value="14" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames EnableDependentAnimation="True"
                                                                       Storyboard.TargetName="SwitchKnobOff"
                                                                       Storyboard.TargetProperty="Width">
                                            <SplineDoubleKeyFrame KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                                  KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                  Value="17" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames EnableDependentAnimation="True"
                                                                       Storyboard.TargetName="SwitchKnobOff"
                                                                       Storyboard.TargetProperty="Height">
                                            <SplineDoubleKeyFrame KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                                  KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                  Value="14" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchHeaderForegroundDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OffContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchContentForegroundDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OnContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchContentForegroundDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                      Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)">
                                            <LinearColorKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                 Value="{ThemeResource ToggleSwitchStrokeOffDisabled}" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                      Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                            <LinearColorKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                 Value="{ThemeResource ToggleSwitchFillOffDisabled}" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchFillOnDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                       Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchStrokeOnDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff"
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchKnobFillOffDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleSwitchKnobFillOnDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid"
                                                                      Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
                                            <LinearColorKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                 Value="{ThemeResource ToggleSwitchContainerBackgroundDisabled}" />
                                        </ColorAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames EnableDependentAnimation="True"
                                                                       Storyboard.TargetName="SwitchKnobOn"
                                                                       Storyboard.TargetProperty="Width">
                                            <SplineDoubleKeyFrame KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                                  KeyTime="{StaticResource ControlNormalAnimationDuration}"
                                                                  Value="12" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames EnableDependentAnimation="True"
                                                                       Storyboard.TargetName="SwitchKnobOn"
                                                                       Storyboard.TargetProperty="Height">
                                            <SplineDoubleKeyFrame KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                                  KeyTime="{StaticResource ControlNormalAnimationDuration}"
                                                                  Value="12" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames EnableDependentAnimation="True"
                                                                       Storyboard.TargetName="SwitchKnobOff"
                                                                       Storyboard.TargetProperty="Width">
                                            <SplineDoubleKeyFrame KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                                  KeyTime="{StaticResource ControlNormalAnimationDuration}"
                                                                  Value="12" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames EnableDependentAnimation="True"
                                                                       Storyboard.TargetName="SwitchKnobOff"
                                                                       Storyboard.TargetProperty="Height">
                                            <SplineDoubleKeyFrame KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                                  KeyTime="{StaticResource ControlNormalAnimationDuration}"
                                                                  Value="12" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ToggleStates">

                                <VisualStateGroup.Transitions>
                                    <VisualTransition x:Name="DraggingToOnTransition"
                                                      GeneratedDuration="0"
                                                      From="Dragging"
                                                      To="On">

                                        <Storyboard>
                                            <RepositionThemeAnimation FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobCurrentToOnOffset}"
                                                                      TargetName="SwitchKnob" />
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                           Storyboard.TargetProperty="Opacity">
                                                <LinearDoubleKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                      Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                           Storyboard.TargetProperty="Opacity">
                                                <LinearDoubleKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                      Value="0" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn"
                                                                           Storyboard.TargetProperty="Opacity">
                                                <LinearDoubleKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                      Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff"
                                                                           Storyboard.TargetProperty="Opacity">
                                                <LinearDoubleKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                      Value="0" />
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition x:Name="OnToDraggingTransition"
                                                      GeneratedDuration="0"
                                                      From="On"
                                                      To="Dragging">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                           Storyboard.TargetProperty="Opacity">
                                                <LinearDoubleKeyFrame KeyTime="0"
                                                                      Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn"
                                                                           Storyboard.TargetProperty="Opacity">
                                                <LinearDoubleKeyFrame KeyTime="0"
                                                                      Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff"
                                                                           Storyboard.TargetProperty="Opacity">
                                                <LinearDoubleKeyFrame KeyTime="0"
                                                                      Value="0" />
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition x:Name="DraggingToOffTransition"
                                                      GeneratedDuration="0"
                                                      From="Dragging"
                                                      To="Off">

                                        <Storyboard>
                                            <RepositionThemeAnimation FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobCurrentToOffOffset}"
                                                                      TargetName="SwitchKnob" />
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                           Storyboard.TargetProperty="Opacity">
                                                <LinearDoubleKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                      Value="0" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn"
                                                                           Storyboard.TargetProperty="Opacity">
                                                <LinearDoubleKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                      Value="0" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff"
                                                                           Storyboard.TargetProperty="Opacity">
                                                <LinearDoubleKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                      Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition x:Name="OnToOffTransition"
                                                      GeneratedDuration="0"
                                                      From="On"
                                                      To="Off">

                                        <Storyboard>
                                            <RepositionThemeAnimation FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobOnToOffOffset}"
                                                                      TargetName="SwitchKnob" />
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition x:Name="OffToOnTransition"
                                                      GeneratedDuration="0"
                                                      From="Off"
                                                      To="On">

                                        <Storyboard>
                                            <RepositionThemeAnimation FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobOffToOnOffset}"
                                                                      TargetName="SwitchKnob" />
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                           Storyboard.TargetProperty="Opacity">
                                                <LinearDoubleKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                      Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                           Storyboard.TargetProperty="Opacity">
                                                <LinearDoubleKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                      Value="0" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn"
                                                                           Storyboard.TargetProperty="Opacity">
                                                <LinearDoubleKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                      Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff"
                                                                           Storyboard.TargetProperty="Opacity">
                                                <LinearDoubleKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                      Value="0" />
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Dragging" />
                                <VisualState x:Name="Off" />
                                <VisualState x:Name="On">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="KnobTranslateTransform"
                                                         Storyboard.TargetProperty="X"
                                                         To="20"
                                                         Duration="0" />
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds"
                                                                       Storyboard.TargetProperty="Opacity">
                                            <LinearDoubleKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                       Storyboard.TargetProperty="Opacity">
                                            <LinearDoubleKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                  Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn"
                                                                       Storyboard.TargetProperty="Opacity">
                                            <LinearDoubleKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOff"
                                                                       Storyboard.TargetProperty="Opacity">
                                            <LinearDoubleKeyFrame KeyTime="{StaticResource ControlFasterAnimationDuration}"
                                                                  Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ContentStates">
                                <VisualState x:Name="OffContent">

                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="OffContentPresenter"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="0" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OffContentPresenter"
                                                                       Storyboard.TargetProperty="IsHitTestVisible">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <x:Boolean>True</x:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="OnContent">

                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="OnContentPresenter"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="0" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OnContentPresenter"
                                                                       Storyboard.TargetProperty="IsHitTestVisible">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <x:Boolean>True</x:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                            </VisualStateGroup>

                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="NavigatorButtonStyle"
           TargetType="Button">
        <Setter Property="Background" Value="{ThemeResource ExpanderHeaderBackground}" />
        <Setter Property="MinWidth" Value="{ThemeResource FlyoutThemeMinWidth}" />
        <Setter Property="MinHeight" Value="64" />
        <Setter Property="BorderThickness" Value="{ThemeResource ExpanderHeaderBorderThickness}" />
        <Setter Property="BorderBrush" Value="{ThemeResource ExpanderHeaderBorderBrush}" />
        <Setter Property="Padding" Value="16,0,8,0" />
        <Setter Property="Margin" Value="0,4,0,0" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid x:Name="Grid"
                          Padding="{TemplateBinding Padding}"
                          AutomationProperties.AccessibilityView="Raw"
                          Background="{TemplateBinding Background}"
                          BorderBrush="{TemplateBinding BorderBrush}"
                          BorderThickness="{TemplateBinding BorderThickness}"
                          CornerRadius="{TemplateBinding CornerRadius}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <ContentPresenter x:Name="ContentPresenter"
                                          Grid.Column="0"
                                          HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                          Content="{TemplateBinding Content}"
                                          ContentTemplate="{TemplateBinding ContentTemplate}"
                                          ContentTransitions="{TemplateBinding ContentTransitions}" />
                        <FontIcon Grid.Column="1"
                                  Margin="20,0,8,0"
                                  HorizontalAlignment="Right"
                                  FontSize="10"
                                  FontWeight="Black"
                                  Glyph="&#xE76C;" />

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleButtonBackgroundPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid"
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleButtonBorderBrushPointerOver}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleButtonBackgroundPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grid"
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{ThemeResource ToggleButtonBorderBrushPressed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="NewInfoBadge"
           TargetType="muxc:InfoBadge">
        <Setter Property="Padding" Value="5,1,5,2" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="muxc:InfoBadge">
                    <Border x:Name="RootGrid"
                            Padding="{TemplateBinding Padding}"
                            Background="{TemplateBinding Background}"
                            CornerRadius="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.InfoBadgeCornerRadius}">
                        <TextBlock x:Uid="NewInfoBadgeTextBlock"
                                   HorizontalAlignment="Center"
                                   VerticalAlignment="Center"
                                   FontSize="10" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
