<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Style TargetType="TextBlock" x:Name="TextBlockSettingsHeaderStyle" >
        <Setter Property="FontFamily" Value="Segoe UI" />
        <Setter Property="FontSize" Value="14.667" />
        <Setter Property="FontWeight" Value="SemiLight" />
    </Style>

    <!-- Custom style for Windows.UI.Xaml.Controls.Primitives.HyperlinkButton -->
    <Style TargetType="HyperlinkButton" x:Name="MainColorHyperlinkButton">
        <Setter Property="Foreground" Value="{ThemeResource HyperlinkForegroundThemeBrush}" />
        <Setter Property="Background" Value="{ThemeResource HyperlinkButtonBackgroundThemeBrush}" />
        <Setter Property="BorderBrush" Value="{ThemeResource HyperlinkButtonBorderThemeBrush}" />
        <Setter Property="BorderThickness" Value="{ThemeResource HyperlinkButtonBorderThemeThickness}" />
        <Setter Property="Padding" Value="12,4,12,5" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
        <Setter Property="FontWeight" Value="SemiBold" />
        <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="HyperlinkButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Opacity">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0.5" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemColorHotlightColor}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource HyperlinkDisabledThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="FocusVisualWhite"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="FocusVisualBlack"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="PointerFocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Border"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Margin="3">
                            <ContentPresenter x:Name="ContentPresenter"
                                              Content="{TemplateBinding Content}"
                                              ContentTransitions="{TemplateBinding ContentTransitions}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}"
                                              Margin="{TemplateBinding Padding}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
                                              AutomationProperties.AccessibilityView="Raw"/>
                        </Border>
                        <Rectangle x:Name="FocusVisualWhite"
                                   IsHitTestVisible="False"
                                   Stroke="{ThemeResource FocusVisualWhiteStrokeThemeBrush}"
                                   StrokeEndLineCap="Square"
                                   StrokeDashArray="1,1"
                                   Opacity="0"
                                   StrokeDashOffset="1.5" />
                        <Rectangle x:Name="FocusVisualBlack"
                                   IsHitTestVisible="False"
                                   Stroke="{ThemeResource FocusVisualBlackStrokeThemeBrush}"
                                   StrokeEndLineCap="Square"
                                   StrokeDashArray="1,1"
                                   Opacity="0"
                                   StrokeDashOffset="0.5" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Custom style for Windows.UI.Xaml.Controls.SearchBox -->
    <Style TargetType="SearchBox" x:Name="MainColorSearchBox">
        <Setter Property="Background" Value="{ThemeResource SearchBoxBackgroundThemeBrush}" />
        <Setter Property="BorderBrush" Value="{ThemeResource SearchBoxBorderThemeBrush}" />
        <Setter Property="BorderThickness" Value="{ThemeResource SearchBoxBorderThemeThickness}" />
        <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
        <Setter Property="FontSize" Value="{ThemeResource SearchBoxContentThemeFontSize}" />
        <Setter Property="FontWeight" Value="{ThemeResource SearchBoxContentThemeFontWeight}"/>
        <Setter Property="Foreground" Value="{ThemeResource SearchBoxForegroundThemeBrush}" />
        <Setter Property="Padding" Value="{ThemeResource SearchBoxThemePadding}"/>
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Typography.StylisticSet20" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="SearchBox">
                    <Grid x:Name="SearchBoxGrid">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchBoxGrid" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Background}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchBoxBorder" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchButton" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Foreground}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchBoxGrid" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SearchBoxPointerOverBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchBoxBorder" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SearchBoxPointerOverBorderThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchButton" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SearchBoxPointerOverTextThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchBoxGrid" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SearchBoxDisabledBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchBoxBorder" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SearchBoxDisabledBorderThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchButton" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SearchBoxDisabledTextThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchTextBox" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchBoxGrid" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SearchBoxFocusedBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchBoxBorder" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SearchBoxFocusedBorderThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchButton" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SearchBoxButtonForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchButton" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource MainColor}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchSuggestionsPopupBorder" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SearchBoxFocusedBorderThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="FocusedDropDown">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchBoxGrid" Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SearchBoxFocusedBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchBoxBorder" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SearchBoxFocusedBorderThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchButton" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SearchBoxFocusedTextThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchSuggestionsPopupBorder" Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SearchBoxFocusedBorderThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.Resources>
                            <Style x:Key="SearchButtonStyle" TargetType="Button">
                                <Setter Property="IsTabStop" Value="False" />
                                <Setter Property="VerticalAlignment" Value="Stretch" />
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="Button">
                                            <Grid Background="Transparent">
                                                <VisualStateManager.VisualStateGroups>
                                                    <VisualStateGroup x:Name="CommonStates">
                                                        <VisualState x:Name="Normal" />
                                                        <VisualState x:Name="PointerOver">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchGlyph" Storyboard.TargetProperty="Foreground">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SearchBoxButtonPointerOverForegroundThemeBrush}" />
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchButtonBackground" Storyboard.TargetProperty="Background">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource MainColor}" />
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchGlyph" Storyboard.TargetProperty="Foreground">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SearchBoxFocusedTextThemeBrush}" />
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SearchButtonBackground" Storyboard.TargetProperty="Background">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SearchBoxFocusedBackgroundThemeBrush}" />
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Disabled" />
                                                    </VisualStateGroup>
                                                    <VisualStateGroup x:Name="FocusStates">
                                                        <VisualState x:Name="Focused" />
                                                        <VisualState x:Name="Unfocused" />
                                                        <VisualState x:Name="PointerFocused" />
                                                    </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <Grid x:Name="SearchButtonBackground" Background="{TemplateBinding Background}">
                                                    <TextBlock x:Name="SearchGlyph"
                                                               AutomationProperties.AccessibilityView="Raw"
                                                               FontFamily="{ThemeResource SymbolThemeFontFamily}"
                                                               Foreground="{TemplateBinding Foreground}"
                                                               HorizontalAlignment="Center"
                                                               FontStyle="Normal"
                                                               Text="&#xE094;"
                                                               VerticalAlignment="Center" />
                                                </Grid>
                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                            <Style x:Key="SearchTextBoxStyle" TargetType="TextBox">
                                <Setter Property="MinWidth" Value="{ThemeResource TextControlThemeMinWidth}" />
                                <Setter Property="MinHeight" Value="{ThemeResource TextControlThemeMinHeight}" />
                                <Setter Property="Foreground" Value="{ThemeResource TextBoxForegroundThemeBrush}" />
                                <Setter Property="Background" Value="{ThemeResource TextBoxBackgroundThemeBrush}" />
                                <Setter Property="BorderBrush" Value="{ThemeResource TextBoxBorderThemeBrush}" />
                                <Setter Property="SelectionHighlightColor" Value="{ThemeResource MainColor}" />
                                <Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}" />
                                <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
                                <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
                                <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
                                <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
                                <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
                                <Setter Property="Padding" Value="{ThemeResource TextControlThemePadding}"/>
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="TextBox">
                                            <Grid>
                                                <VisualStateManager.VisualStateGroups>
                                                    <VisualStateGroup x:Name="CommonStates">
                                                        <VisualState x:Name="Disabled">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundElement"
                                                                                               Storyboard.TargetProperty="Background">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextBoxDisabledBackgroundThemeBrush}" />
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement"
                                                                                               Storyboard.TargetProperty="BorderBrush">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextBoxDisabledBorderThemeBrush}" />
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement"
                                                                                               Storyboard.TargetProperty="Foreground">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextBoxDisabledForegroundThemeBrush}" />
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter"
                                                                                               Storyboard.TargetProperty="Foreground">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextBoxDisabledForegroundThemeBrush}" />
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Normal">
                                                            <Storyboard>
                                                                <DoubleAnimation Storyboard.TargetName="BackgroundElement"
                                                                                 Storyboard.TargetProperty="Opacity"
                                                                                 Duration="0"
                                                                                 To="{ThemeResource TextControlBackgroundThemeOpacity}" />
                                                                <DoubleAnimation Storyboard.TargetName="BorderElement"
                                                                                 Storyboard.TargetProperty="Opacity"
                                                                                 Duration="0"
                                                                                 To="{ThemeResource TextControlBorderThemeOpacity}" />
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="PointerOver">
                                                            <Storyboard>
                                                                <DoubleAnimation Storyboard.TargetName="BackgroundElement"
                                                                                 Storyboard.TargetProperty="Opacity"
                                                                                 Duration="0"
                                                                                 To="{ThemeResource TextControlPointerOverBackgroundThemeOpacity}" />
                                                                <DoubleAnimation Storyboard.TargetName="BorderElement"
                                                                                 Storyboard.TargetProperty="Opacity"
                                                                                 Duration="0"
                                                                                 To="{ThemeResource TextControlPointerOverBorderThemeOpacity}" />
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Focused" />
                                                    </VisualStateGroup>
                                                    <VisualStateGroup x:Name="ButtonStates" />
                                                </VisualStateManager.VisualStateGroups>
                                                <Grid.RowDefinitions>
                                                    <RowDefinition Height="Auto" />
                                                    <RowDefinition Height="*" />
                                                </Grid.RowDefinitions>
                                                <Border x:Name="BackgroundElement"
                                                        Grid.Row="1"
                                                        Background="{TemplateBinding Background}"
                                                        Margin="{TemplateBinding BorderThickness}"
                                                        Grid.RowSpan="1"/>
                                                <Border x:Name="BorderElement"
                                                        Grid.Row="1"
                                                        BorderBrush="{TemplateBinding BorderBrush}"
                                                        BorderThickness="{TemplateBinding BorderThickness}"
                                                        Grid.RowSpan="1"/>
                                                <ContentPresenter x:Name="HeaderContentPresenter"
                                                                  Grid.Row="0"
                                                                  Foreground="{ThemeResource TextBoxForegroundHeaderThemeBrush}"
                                                                  Margin="0,4,0,4"
                                                                  Content="{TemplateBinding Header}"
                                                                  ContentTemplate="{TemplateBinding HeaderTemplate}"
                                                                  FontWeight="Semilight" />
                                                <ScrollViewer x:Name="ContentElement"
                                                              Grid.Row="1"
                                                              HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
                                                              HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
                                                              VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
                                                              VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
                                                              IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
                                                              IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
                                                              IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
                                                              Margin="{TemplateBinding BorderThickness}"
                                                              Padding="{TemplateBinding Padding}"
                                                              IsTabStop="False"
                                                              AutomationProperties.AccessibilityView="Raw"
                                                              ZoomMode="Disabled" />
                                                <ContentControl x:Name="PlaceholderTextContentPresenter"
                                                              Grid.Row="1"
                                                              Foreground="{ThemeResource TextBoxPlaceholderTextThemeBrush}"
                                                              Margin="{TemplateBinding BorderThickness}"
                                                              Padding="{TemplateBinding Padding}"
                                                              IsTabStop="False"
                                                              Grid.ColumnSpan="2"
                                                              Content="{TemplateBinding PlaceholderText}"
                                                              IsHitTestVisible="False" />
                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </Grid.Resources>
                        <Border x:Name="SearchBoxBorder"
                                Background="Transparent"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <TextBox x:Name="SearchTextBox"
                                         BorderThickness="0"
                                         Background="Transparent"
                                         FontFamily="{TemplateBinding FontFamily}"
                                         FontSize="{TemplateBinding FontSize}"
                                         FontWeight="{TemplateBinding FontWeight}"
                                         Foreground="{TemplateBinding Foreground}"
                                         InputScope="Search"
                                         MaxLength="2048"
                                         MinHeight="{ThemeResource SearchBoxTextBoxThemeMinHeight}"
                                         Padding="{TemplateBinding Padding}"
                                         PlaceholderText="{TemplateBinding PlaceholderText}"
                                         Style="{StaticResource SearchTextBoxStyle}"
                                         TextWrapping="NoWrap"
                                         VerticalAlignment="Stretch" />
                                <Button x:Name="SearchButton"
                                            AutomationProperties.AccessibilityView="Raw"
                                            Background="Transparent"
                                            FontWeight="{ThemeResource SearchBoxButtonThemeFontWeight}"
                                            Grid.Column="1"
                                            Style="{StaticResource SearchButtonStyle}" />
                            </Grid>
                        </Border>
                        <Popup x:Name="SearchSuggestionsPopup"
                               HorizontalAlignment="Left"
                               VerticalAlignment="Bottom">
                            <Border x:Name="SearchSuggestionsPopupBorder"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    MinWidth="{ThemeResource SearchBoxSuggestionPopupThemeMinWidth}">
                                <Border.Resources>
                                    <Style x:Key="SearchSuggestionListViewItemStyle" TargetType="ListViewItem">
                                        <Setter Property="Background" Value="Transparent" />
                                        <Setter Property="TabNavigation" Value="Local" />
                                        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                                        <Setter Property="Margin" Value="0"/>
                                        <Setter Property="Template">
                                            <Setter.Value>
                                                <ControlTemplate TargetType="ListViewItem">
                                                    <Border x:Name="OuterContainer">
                                                        <VisualStateManager.VisualStateGroups>
                                                            <VisualStateGroup x:Name="CommonStates">
                                                                <VisualState x:Name="Normal"/>
                                                                <VisualState x:Name="PointerOver">
                                                                    <Storyboard>
                                                                        <DoubleAnimation Storyboard.TargetName="PointerOverBorder"
                                                                                         Storyboard.TargetProperty="Opacity"
                                                                                         Duration="0"
                                                                                         To="1" />
                                                                    </Storyboard>
                                                                </VisualState>
                                                                <VisualState x:Name="Pressed">
                                                                    <Storyboard>
                                                                        <PointerDownThemeAnimation TargetName="ContentContainer" />
                                                                    </Storyboard>
                                                                </VisualState>
                                                                <VisualState x:Name="PointerOverPressed">
                                                                    <Storyboard>
                                                                        <PointerDownThemeAnimation TargetName="ContentContainer" />
                                                                        <DoubleAnimation Storyboard.TargetName="PointerOverBorder"
                                                                                         Storyboard.TargetProperty="Opacity"
                                                                                         Duration="0"
                                                                                         To="1" />
                                                                    </Storyboard>
                                                                </VisualState>
                                                                <VisualState x:Name="Disabled">
                                                                    <Storyboard>
                                                                        <DoubleAnimation Storyboard.TargetName="ListViewItemContentPresenter"
                                                                                         Storyboard.TargetProperty="Opacity"
                                                                                         Duration="0"
                                                                                         To="{ThemeResource ListViewItemDisabledThemeOpacity}" />
                                                                    </Storyboard>
                                                                </VisualState>
                                                            </VisualStateGroup>
                                                            <VisualStateGroup x:Name="FocusStates">
                                                                <VisualState x:Name="Focused">
                                                                    <Storyboard>
                                                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisual" />
                                                                    </Storyboard>
                                                                </VisualState>
                                                                <VisualState x:Name="Unfocused"/>
                                                                <VisualState x:Name="PointerFocused"/>
                                                            </VisualStateGroup>
                                                            <VisualStateGroup x:Name="SelectionStates">
                                                                <VisualState x:Name="Unselecting" />
                                                                <VisualState x:Name="Unselected" />
                                                                <VisualState x:Name="UnselectedPointerOver">
                                                                    <Storyboard>
                                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ListViewItemContentPresenter"
                                                                                                       Storyboard.TargetProperty="Foreground">
                                                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SearchBoxButtonForegroundThemeBrush}" />
                                                                        </ObjectAnimationUsingKeyFrames>
                                                                    </Storyboard>
                                                                </VisualState>
                                                                <VisualState x:Name="UnselectedSwiping" />
                                                                <VisualState x:Name="Selecting" />
                                                                <VisualState x:Name="Selected">
                                                                    <Storyboard>
                                                                        <DoubleAnimation Storyboard.TargetName="SelectionBackground"
                                                                                         Storyboard.TargetProperty="Opacity"
                                                                                         Duration="0"
                                                                                         To="1" />
                                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ListViewItemContentPresenter"
                                                                                                       Storyboard.TargetProperty="Foreground">
                                                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SearchBoxButtonForegroundThemeBrush}" />
                                                                        </ObjectAnimationUsingKeyFrames>
                                                                    </Storyboard>
                                                                </VisualState>
                                                                <VisualState x:Name="SelectedSwiping" />
                                                                <VisualState x:Name="SelectedUnfocused">
                                                                    <Storyboard>
                                                                        <DoubleAnimation Storyboard.TargetName="SelectionBackground"
                                                                                         Storyboard.TargetProperty="Opacity"
                                                                                         Duration="0"
                                                                                         To="1" />
                                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ListViewItemContentPresenter"
                                                                                                       Storyboard.TargetProperty="Foreground">
                                                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SearchBoxButtonForegroundThemeBrush}" />
                                                                        </ObjectAnimationUsingKeyFrames>
                                                                    </Storyboard>
                                                                </VisualState>
                                                            </VisualStateGroup>
                                                        </VisualStateManager.VisualStateGroups>
                                                        <Grid x:Name="ContentContainer">
                                                            <Rectangle x:Name="PointerOverBorder"
                                                                       IsHitTestVisible="False"
                                                                       Opacity="0"
                                                                       Fill="{ThemeResource MainColor}" />
                                                            <Rectangle x:Name="FocusVisual"
                                                                       IsHitTestVisible="False"
                                                                       Opacity="0"
                                                                       StrokeThickness="2"
                                                                       Stroke="{ThemeResource ListViewItemFocusBorderThemeBrush}" />
                                                            <Rectangle x:Name="SelectionBackground"
                                                                       Fill="{ThemeResource MainColor}"
                                                                       Opacity="0" />
                                                            <ContentPresenter x:Name="ListViewItemContentPresenter"
                                                                              ContentTransitions="{TemplateBinding ContentTransitions}"
                                                                              ContentTemplate="{TemplateBinding ContentTemplate}"
                                                                              Content="{TemplateBinding Content}"
                                                                              FontFamily="{Binding ElementName=SearchTextBox, Path=FontFamily}"
                                                                              FontSize="{Binding ElementName=SearchTextBox, Path=FontSize}"
                                                                              FontWeight="{Binding ElementName=SearchTextBox, Path=FontWeight}"
                                                                              Foreground="{TemplateBinding Foreground}"
                                                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                                                        </Grid>
                                                    </Border>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </Border.Resources>
                                <Grid MaxHeight="{ThemeResource SearchBoxSuggestionPopupThemeMaxHeight}">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                    <Border x:Name="IMECandidateListContainer" />
                                    <Border x:Name="IMECandidateListSeparator" Grid.Row="1" Visibility="Collapsed" BorderThickness="{ThemeResource SearchBoxIMECandidateListSeparatorThemeThickness}" BorderBrush="{ThemeResource SearchBoxIMECandidateListSeparatorThemeBrush}" />
                                    <ListView x:Name="SearchSuggestionsList"
                                              Background="{ThemeResource TextBoxBackgroundThemeBrush}"
                                              Grid.Row="2"
                                              IsTabStop="False"
                                              IsItemClickEnabled="true"
                                              ItemContainerStyle="{StaticResource SearchSuggestionListViewItemStyle}">
                                        <ListView.Resources>
                                            <DataTemplate x:Name="HitHighlightedTextBlock">
                                                <RichTextBlock x:Name="TextBlock" TextWrapping="Wrap" TextTrimming="WordEllipsis" SelectionHighlightColor="{ThemeResource MainColor}" AutomationProperties.AccessibilityView="Raw">
                                                    <RichTextBlock.Resources>
                                                        <DataTemplate x:Name="SelectedHitHighlightedRun">
                                                            <Run Foreground="{ThemeResource TextColor}" FontFamily="Global User Interface" />
                                                        </DataTemplate>
                                                    </RichTextBlock.Resources>
                                                </RichTextBlock>
                                            </DataTemplate>
                                        </ListView.Resources>
                                        <ListView.ItemContainerTransitions>
                                            <TransitionCollection />
                                        </ListView.ItemContainerTransitions>
                                        <ListView.ItemTemplate>
                                            <DataTemplate>
                                                <Grid>
                                                    <!-- QuerySuggestionTemplate is presented for suggestions of Kind SearchSuggestionKind_Query -->
                                                    <ContentControl x:Name="QuerySuggestionTemplate"
                                                                    Margin="{ThemeResource SearchBoxQuerySuggestionThemeMargin}"
                                                                    Typography.DiscretionaryLigatures="False"
                                                                    VerticalAlignment="Center"
                                                                    Visibility="Collapsed" />

                                                    <!-- ResultSuggestionTemplate is presented for suggestions of Kind SearchSuggestionKind_Result -->
                                                    <Grid x:Name="ResultSuggestionTemplate"
                                                          Margin="{ThemeResource SearchBoxResultSuggestionThemeMargin}"
                                                          Typography.DiscretionaryLigatures="False"
                                                          Visibility="Collapsed" >
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="Auto" />
                                                            <ColumnDefinition />
                                                        </Grid.ColumnDefinitions>
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition />
                                                            <RowDefinition />
                                                        </Grid.RowDefinitions>
                                                        <Image x:Name="ResultSuggestionImage"
                                                               Grid.RowSpan="2"
                                                               Width="{ThemeResource SearchBoxResultSuggestionImageThemeWidth}"
                                                               Height="{ThemeResource SearchBoxResultSuggestionImageThemeHeight}"
                                                               Margin="{ThemeResource SearchBoxSuggestionSubcomponentThemeMargin}"/>
                                                        <ContentControl x:Name="ResultSuggestionText"
                                                                        Grid.Column="1"
                                                                        VerticalAlignment="Center"
                                                                        FontWeight="SemiBold" />
                                                        <ContentControl x:Name="ResultSuggestionDetailText"
                                                                        Grid.Column="1"
                                                                        Grid.Row="1"
                                                                        VerticalAlignment="Center" />
                                                    </Grid>

                                                    <!-- SeparatorSuggestionTemplate is presented for suggestions of Kind SearchSuggestionKind_Separator -->
                                                    <Grid x:Name="SeparatorSuggestionTemplate"
                                                          Margin="{ThemeResource SearchBoxSeparatorSuggestionThemeMargin}"
                                                          Typography.DiscretionaryLigatures="False"
                                                          Visibility="Collapsed">
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="Auto" />
                                                            <ColumnDefinition />
                                                        </Grid.ColumnDefinitions>
                                                        <TextBlock x:Name="SeparatorSuggestionText"
                                                                   Margin="{ThemeResource SearchBoxSuggestionSubcomponentThemeMargin}"
                                                                   SelectionHighlightColor="{ThemeResource MainColor}"
                                                                   TextTrimming="WordEllipsis"
                                                                   VerticalAlignment="Center" />
                                                        <Border Grid.Column="1"
                                                                BorderBrush="{ThemeResource SearchBoxSeparatorSuggestionForegroundThemeBrush}"
                                                                BorderThickness="0,1,0,0"
                                                                VerticalAlignment="Center"/>
                                                    </Grid>
                                                </Grid>
                                            </DataTemplate>
                                        </ListView.ItemTemplate>
                                    </ListView>
                                </Grid>
                            </Border>
                        </Popup>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Custom style for Windows.UI.Xaml.Controls.ToggleSwitch -->
    <Style TargetType="ToggleSwitch" x:Name="MainColorToggleSwitch">
        <Setter Property="Foreground" Value="{ThemeResource ToggleSwitchForegroundThemeBrush}" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
        <Setter Property="FontWeight" Value="SemiBold" />
        <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
        <Setter Property="MinWidth" Value="154" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleSwitch">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchCurtain"
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource MainColor}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="InnerBorder"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchTrackPointerOverBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnob"
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchThumbPointerOverBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnob"
                                                                       Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchThumbPointerOverBorderThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchCurtain"
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource MainColor}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="InnerBorder"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchTrackPressedBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnob"
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchThumbPressedBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnob"
                                                                       Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchThumbPressedForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchHeaderDisabledForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OffContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchDisabledForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OnContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchDisabledForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder"
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchOuterBorderDisabledBorderThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="InnerBorder"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchTrackDisabledBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnob"
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchThumbDisabledBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnob"
                                                                       Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchThumbDisabledBorderThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchCurtain"
                                                                       Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchCurtainDisabledBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ToggleStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition x:Name="DraggingToOnTransition"
                                                      From="Dragging"
                                                      To="On"
                                                      GeneratedDuration="0">
                                        <Storyboard>
                                            <RepositionThemeAnimation TargetName="SwitchKnob" FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobCurrentToOnOffset}" />
                                            <RepositionThemeAnimation TargetName="SwitchCurtain" FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.CurtainCurrentToOnOffset}" />
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition x:Name="DraggingToOffTransition"
                                                      From="Dragging"
                                                      To="Off"
                                                      GeneratedDuration="0">
                                        <Storyboard>
                                            <RepositionThemeAnimation TargetName="SwitchKnob" FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobCurrentToOffOffset}" />
                                            <RepositionThemeAnimation TargetName="SwitchCurtain" FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.CurtainCurrentToOffOffset}" />
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition x:Name="OnToOffTransition"
                                                      From="On"
                                                      To="Off"
                                                      GeneratedDuration="0">
                                        <Storyboard>
                                            <RepositionThemeAnimation TargetName="SwitchKnob" FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobOnToOffOffset}" />
                                            <RepositionThemeAnimation TargetName="SwitchCurtain" FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.CurtainOnToOffOffset}" />
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition x:Name="OffToOnTransition"
                                                      From="Off"
                                                      To="On"
                                                      GeneratedDuration="0">
                                        <Storyboard>
                                            <RepositionThemeAnimation TargetName="SwitchKnob" FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobOffToOnOffset}" />
                                            <RepositionThemeAnimation TargetName="SwitchCurtain" FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.CurtainOffToOnOffset}" />
                                        </Storyboard>
                                    </VisualTransition>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Dragging" />
                                <VisualState x:Name="Off">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="CurtainTranslateTransform"
                                                         Storyboard.TargetProperty="X"
                                                         To="-44"
                                                         Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="On">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="CurtainTranslateTransform"
                                                         Storyboard.TargetProperty="X"
                                                         To="0"
                                                         Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="KnobTranslateTransform"
                                                         Storyboard.TargetProperty="X"
                                                         To="38"
                                                         Duration="0" />
                                    </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.TargetProperty="IsHitTestVisible" Storyboard.TargetName="OffContentPresenter">
                                            <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.TargetProperty="IsHitTestVisible" Storyboard.TargetName="OnContentPresenter">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <x:Boolean>True</x:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="FocusVisualWhite"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="FocusVisualBlack"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="PointerFocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <ContentPresenter x:Name="HeaderContentPresenter"
                                              Foreground="{ThemeResource ToggleSwitchHeaderForegroundThemeBrush}"
                                              Margin="6"
                                              Grid.ColumnSpan="2"
                                              Content="{TemplateBinding Header}"
                                              ContentTemplate="{TemplateBinding HeaderTemplate}"
                                              FontWeight="Semilight"
                                              AutomationProperties.AccessibilityView="Raw" />
                            <Grid Grid.Row="1" Margin="{TemplateBinding Padding}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="7" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <ContentPresenter x:Name="OffContentPresenter"
                                                  MinWidth="65"
                                                  Margin="6,5,0,16"
                                                  Opacity="0"
                                                  IsHitTestVisible="False"
                                                  Content="{TemplateBinding OffContent}"
                                                  ContentTemplate="{TemplateBinding OffContentTemplate}"
                                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                  AutomationProperties.AccessibilityView="Raw" />
                                <ContentPresenter x:Name="OnContentPresenter"
                                                  MinWidth="65"
                                                  Margin="6,5,0,16"
                                                  Opacity="0"
                                                  IsHitTestVisible="False"
                                                  Content="{TemplateBinding OnContent}"
                                                  ContentTemplate="{TemplateBinding OnContentTemplate}"
                                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                  AutomationProperties.AccessibilityView="Raw" />
                                <Grid Grid.Column="2" Background="Transparent" ManipulationMode="None">
                                    <Grid x:Name="SwitchKnobBounds" Height="19" Margin="13,5,13,16">
                                        <Border x:Name="OuterBorder"
                                                BorderBrush="{ThemeResource ToggleSwitchOuterBorderBorderThemeBrush}"
                                                BorderThickness="2">
                                            <Border x:Name="InnerBorder"
                                                    Background="{ThemeResource ToggleSwitchTrackBackgroundThemeBrush}"
                                                    BorderBrush="{ThemeResource ToggleSwitchTrackBorderThemeBrush}"
                                                    BorderThickness="1">
                                                <ContentPresenter x:Name="SwitchCurtainBounds">
                                                    <ContentPresenter x:Name="SwitchCurtainClip">
                                                        <Rectangle x:Name="SwitchCurtain"
                                                                   Fill="{ThemeResource MainColor}"
                                                                   Width="44">
                                                            <Rectangle.RenderTransform>
                                                                <TranslateTransform x:Name="CurtainTranslateTransform" X="-44" />
                                                            </Rectangle.RenderTransform>
                                                        </Rectangle>
                                                    </ContentPresenter>
                                                </ContentPresenter>
                                            </Border>
                                        </Border>
                                        <Rectangle x:Name="SwitchKnob"
                                                   Fill="{ThemeResource ToggleSwitchThumbBackgroundThemeBrush}"
                                                   Stroke="{ThemeResource ToggleSwitchThumbBorderThemeBrush}"
                                                   StrokeThickness="1"
                                                   HorizontalAlignment="Left"
                                                   Width="12">
                                            <Rectangle.RenderTransform>
                                                <TranslateTransform x:Name="KnobTranslateTransform" />
                                            </Rectangle.RenderTransform>
                                        </Rectangle>
                                        <Rectangle x:Name="FocusVisualWhite"
                                                   Stroke="{ThemeResource FocusVisualWhiteStrokeThemeBrush}"
                                                   StrokeEndLineCap="Square"
                                                   StrokeDashArray="1,1"
                                                   Opacity="0"
                                                   Margin="-3"
                                                   StrokeDashOffset="1.5" />
                                        <Rectangle x:Name="FocusVisualBlack"
                                                   Stroke="{ThemeResource FocusVisualBlackStrokeThemeBrush}"
                                                   StrokeEndLineCap="Square"
                                                   StrokeDashArray="1,1"
                                                   Opacity="0"
                                                   Margin="-3"
                                                   StrokeDashOffset="0.5" />
                                    </Grid>
                                    <Thumb x:Name="SwitchThumb" AutomationProperties.AccessibilityView="Raw">
                                        <Thumb.Template>
                                            <ControlTemplate TargetType="Thumb">
                                                <Rectangle Fill="Transparent" />
                                            </ControlTemplate>
                                        </Thumb.Template>
                                    </Thumb>
                                </Grid>
                            </Grid>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Custom style for Windows.UI.Xaml.Controls.ComboBoxItem -->
    <Style TargetType="ComboBoxItem" x:Name="MainColorComboBoxItem">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="TabNavigation" Value="Local" />
        <Setter Property="Padding" Value="8,10" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ComboBoxItem">
                    <Border x:Name="LayoutRoot"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxItemPointerOverBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxItemPointerOverForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxItemDisabledForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="PressedBackground"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="0" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxItemPressedForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected" />
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="InnerGrid"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource MainColor}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxItemSelectedForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="SelectedUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="InnerGrid"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource MainColor}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxItemSelectedForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="SelectedDisabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="InnerGrid"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxItemSelectedDisabledBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxItemSelectedDisabledForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="SelectedPointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="InnerGrid"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource MainColor}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxItemSelectedForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="SelectedPressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="InnerGrid"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxItemSelectedBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxItemPressedForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="FocusVisualWhite"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="FocusVisualBlack"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="PointerFocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="InnerGrid"
                              Background="Transparent">
                            <Rectangle x:Name="PressedBackground"
                                       Fill="{ThemeResource ComboBoxItemPressedBackgroundThemeBrush}"
                                       Opacity="0" />
                            <ContentPresenter x:Name="ContentPresenter"
                                              Content="{TemplateBinding Content}"
                                              ContentTransitions="{TemplateBinding ContentTransitions}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              Margin="{TemplateBinding Padding}" />
                            <Rectangle x:Name="FocusVisualWhite"
                                       Stroke="{ThemeResource FocusVisualWhiteStrokeThemeBrush}"
                                       StrokeEndLineCap="Square"
                                       StrokeDashArray="1,1"
                                       Opacity="0"
                                       StrokeDashOffset=".5" />
                            <Rectangle x:Name="FocusVisualBlack"
                                       Stroke="{ThemeResource FocusVisualBlackStrokeThemeBrush}"
                                       StrokeEndLineCap="Square"
                                       StrokeDashArray="1,1"
                                       Opacity="0"
                                       StrokeDashOffset="1.5" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Custom style for Windows.UI.Xaml.Controls.DatePicker -->
    <Style TargetType="DatePicker" x:Name="MainColorDatePicker">
        <Setter Property="Orientation" Value="Horizontal"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
        <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
        <Setter Property="Foreground" Value="{ThemeResource DatePickerForegroundThemeBrush}"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="DatePicker">
                    <Border x:Name="LayoutRoot"
                             Background="{TemplateBinding Background}"
                             BorderBrush="{TemplateBinding BorderBrush}"
                             BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid Margin="{TemplateBinding Padding}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <ContentPresenter x:Name="HeaderContentPresenter"
                                          Foreground="{ThemeResource DatePickerHeaderForegroundThemeBrush}"
                                          Margin="{ThemeResource DatePickerHeaderThemeMargin}"
                                          FlowDirection="{TemplateBinding FlowDirection}"
                                          Content="{TemplateBinding Header}"
                                          ContentTemplate="{TemplateBinding HeaderTemplate}"
                                          FontWeight="{ThemeResource DatePickerHeaderThemeFontWeight}" />
                            <StackPanel Grid.Row="1" Orientation="{TemplateBinding Orientation}">
                                <Border x:Name="FirstPickerHost">
                                    <ComboBox x:Name="DayPicker" 
                                    MinWidth="{ThemeResource DatePickerSelectorThemeMinWidth}"
                                    FontWeight="{TemplateBinding FontWeight}"
                                    FontSize="{TemplateBinding FontSize}"
                                    FontFamily="{TemplateBinding FontFamily}"
                                    Foreground="{TemplateBinding Foreground}"
                                    ItemContainerStyle="{StaticResource MainColorComboBoxItem}" />
                                </Border>
                                <Rectangle x:Name="FirstPickerSpacing"
                                 Width="{ThemeResource DatePickerSpacingThemeWidth}"
                                 Height="{ThemeResource DatePickerSpacingThemeHeight}"/>
                                <Border x:Name="SecondPickerHost">
                                    <ComboBox x:Name="MonthPicker"
                                    MinWidth="{ThemeResource DatePickerSelectorThemeMinWidth}"
                                    FontWeight="{TemplateBinding FontWeight}"
                                    FontSize="{TemplateBinding FontSize}"
                                    FontFamily="{TemplateBinding FontFamily}"
                                    Foreground="{TemplateBinding Foreground}"
                                    ItemContainerStyle="{StaticResource MainColorComboBoxItem}" />
                                </Border>
                                <Rectangle x:Name="SecondPickerSpacing"
                                 Width="{ThemeResource DatePickerSpacingThemeWidth}"
                                 Height="{ThemeResource DatePickerSpacingThemeHeight}"/>
                                <Border x:Name="ThirdPickerHost">
                                    <ComboBox x:Name="YearPicker"
                                     MinWidth="{ThemeResource DatePickerSelectorThemeMinWidth}"
                                     FontWeight="{TemplateBinding FontWeight}"
                                     FontSize="{TemplateBinding FontSize}"
                                     FontFamily="{TemplateBinding FontFamily}"
                                     Foreground="{TemplateBinding Foreground}"
                                     ItemContainerStyle="{StaticResource MainColorComboBoxItem}" />
                                </Border>
                            </StackPanel>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
