<!--
    Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
    the MIT License. See LICENSE in the project root for license information.
-->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:local="using:Microsoft.Terminal.Settings.Editor"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
                    mc:Ignorable="d">

    <ResourceDictionary.ThemeDictionaries>
        <ResourceDictionary x:Key="Light">
            <Style x:Key="SecondaryTextBlockStyle"
                   TargetType="TextBlock">
                <Setter Property="Foreground" Value="{ThemeResource TextFillColorSecondary}" />
            </Style>
            <SolidColorBrush x:Key="SubgroupHeaderBrush"
                             Color="{StaticResource TextFillColorSecondary}" />
            <StaticResource x:Key="ExpanderHeaderBorderBrush"
                            ResourceKey="CardStrokeColorDefaultBrush" />

            <StaticResource x:Key="SettingContainerErrorSeverityBackgroundBrush"
                            ResourceKey="SystemFillColorCriticalBackgroundBrush" />
            <StaticResource x:Key="SettingContainerWarningSeverityBackgroundBrush"
                            ResourceKey="SystemFillColorCautionBackgroundBrush" />

            <StaticResource x:Key="SettingContainerErrorSeverityIconBackground"
                            ResourceKey="SystemFillColorCriticalBrush" />
            <StaticResource x:Key="SettingContainerWarningSeverityIconBackground"
                            ResourceKey="SystemFillColorCautionBrush" />

            <StaticResource x:Key="SettingContainerErrorSeverityIconForeground"
                            ResourceKey="TextFillColorInverseBrush" />
            <StaticResource x:Key="SettingContainerWarningSeverityIconForeground"
                            ResourceKey="TextFillColorInverseBrush" />

            <StaticResource x:Key="SettingContainerTitleForeground"
                            ResourceKey="TextFillColorPrimaryBrush" />
            <StaticResource x:Key="SettingContainerMessageForeground"
                            ResourceKey="TextFillColorPrimaryBrush" />

            <StaticResource x:Key="SettingContainerResetButtonIconForeground"
                            ResourceKey="SystemAccentColorDark2" />

        </ResourceDictionary>
        <ResourceDictionary x:Key="HighContrast">
            <Style x:Key="SecondaryTextBlockStyle"
                   TargetType="TextBlock" />
            <!--  Do not mess with the foreground color for High Contrast. Let it ride as is.  -->
            <SolidColorBrush x:Key="SubgroupHeaderBrush"
                             Color="{ThemeResource SystemColorWindowTextColor}" />
            <StaticResource x:Key="ExpanderHeaderBorderBrush"
                            ResourceKey="SystemColorButtonTextColorBrush" />

            <StaticResource x:Key="SettingContainerErrorSeverityBackgroundBrush"
                            ResourceKey="SystemColorWindowColorBrush" />
            <StaticResource x:Key="SettingContainerWarningSeverityBackgroundBrush"
                            ResourceKey="SystemColorWindowColorBrush" />

            <StaticResource x:Key="SettingContainerErrorSeverityIconBackground"
                            ResourceKey="SystemColorHighlightColorBrush" />
            <StaticResource x:Key="SettingContainerWarningSeverityIconBackground"
                            ResourceKey="SystemColorHighlightColorBrush" />

            <StaticResource x:Key="SettingContainerErrorSeverityIconForeground"
                            ResourceKey="SystemColorHighlightTextColorBrush" />
            <StaticResource x:Key="SettingContainerWarningSeverityIconForeground"
                            ResourceKey="SystemColorHighlightTextColorBrush" />

            <StaticResource x:Key="SettingContainerTitleForeground"
                            ResourceKey="SystemColorWindowTextColorBrush" />
            <StaticResource x:Key="SettingContainerMessageForeground"
                            ResourceKey="SystemColorWindowTextColorBrush" />

            <StaticResource x:Key="SettingContainerResetButtonIconForeground"
                            ResourceKey="SystemAccentColorLight1" />
        </ResourceDictionary>
        <ResourceDictionary x:Key="Dark">
            <Style x:Key="SecondaryTextBlockStyle"
                   TargetType="TextBlock">
                <Setter Property="Foreground" Value="{ThemeResource TextFillColorSecondary}" />
            </Style>
            <SolidColorBrush x:Key="SubgroupHeaderBrush"
                             Color="{StaticResource TextFillColorSecondary}" />
            <StaticResource x:Key="ExpanderHeaderBorderBrush"
                            ResourceKey="CardStrokeColorDefaultBrush" />

            <StaticResource x:Key="SettingContainerErrorSeverityBackgroundBrush"
                            ResourceKey="SystemFillColorCriticalBackgroundBrush" />
            <StaticResource x:Key="SettingContainerWarningSeverityBackgroundBrush"
                            ResourceKey="SystemFillColorCautionBackgroundBrush" />

            <StaticResource x:Key="SettingContainerErrorSeverityIconBackground"
                            ResourceKey="SystemFillColorCriticalBrush" />
            <StaticResource x:Key="SettingContainerWarningSeverityIconBackground"
                            ResourceKey="SystemFillColorCautionBrush" />

            <StaticResource x:Key="SettingContainerErrorSeverityIconForeground"
                            ResourceKey="TextFillColorInverseBrush" />
            <StaticResource x:Key="SettingContainerWarningSeverityIconForeground"
                            ResourceKey="TextFillColorInverseBrush" />

            <StaticResource x:Key="SettingContainerTitleForeground"
                            ResourceKey="TextFillColorPrimaryBrush" />
            <StaticResource x:Key="SettingContainerMessageForeground"
                            ResourceKey="TextFillColorPrimaryBrush" />

            <StaticResource x:Key="SettingContainerResetButtonIconForeground"
                            ResourceKey="SystemAccentColorLight2" />
        </ResourceDictionary>
    </ResourceDictionary.ThemeDictionaries>

    <FontWeight x:Key="SettingContainerTitleFontWeight">SemiBold</FontWeight>

    <x:String x:Key="SettingContainerIconBackgroundGlyph">&#xF136;</x:String>
    <x:String x:Key="SettingContainerErrorIconGlyph">&#xF13D;</x:String>
    <x:String x:Key="SettingContainerWarningIconGlyph">&#xF13C;</x:String>

    <Thickness x:Key="SettingContainerIconMargin">0,4,8,4</Thickness>
    <x:Double x:Key="SettingContainerIconFontSize">16</x:Double>

    <Style x:Key="StackPanelInExpanderStyle"
           TargetType="StackPanel">
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Padding" Value="0,12,0,12" />
    </Style>

    <Style x:Key="SettingContainerResetButtonStyle"
           BasedOn="{StaticResource DefaultButtonStyle}"
           TargetType="Button">
        <Setter Property="Margin" Value="4,0,0,0" />
        <Setter Property="Height" Value="20" />
        <Setter Property="Width" Value="20" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="Background" Value="Transparent" />
    </Style>

    <Style x:Key="SettingContainerFontIconStyle"
           TargetType="FontIcon">
        <Setter Property="Foreground" Value="{ThemeResource SettingContainerResetButtonIconForeground}" />
        <Setter Property="FontSize" Value="12" />
        <Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" />
    </Style>

    <Style x:Key="NonExpanderGrid"
           TargetType="Grid">
        <Setter Property="Background" Value="{ThemeResource ExpanderHeaderBackground}" />
        <Setter Property="MinWidth" Value="{ThemeResource FlyoutThemeMinWidth}" />
        <Setter Property="MinHeight" Value="64" />
        <Setter Property="BorderThickness" Value="{ThemeResource ExpanderHeaderBorderThickness}" />
        <Setter Property="BorderBrush" Value="{ThemeResource ExpanderHeaderBorderBrush}" />
        <Setter Property="Padding" Value="16,0,8,0" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
    </Style>

    <Style x:Key="SettingsPageItemHeaderStyle"
           BasedOn="{StaticResource BodyTextBlockStyle}"
           TargetType="TextBlock">
        <Setter Property="LineHeight" Value="20" />
        <Setter Property="TextWrapping" Value="WrapWholeWords" />
    </Style>

    <Style x:Key="SettingsPageItemDescriptionStyle"
           BasedOn="{StaticResource CaptionTextBlockStyle}"
           TargetType="TextBlock">
        <Setter Property="Margin" Value="0,0,24,0" />
        <Setter Property="LineHeight" Value="16" />
        <Setter Property="Foreground" Value="{ThemeResource SubgroupHeaderBrush}" />
        <Setter Property="TextWrapping" Value="WrapWholeWords" />
        <Setter Property="FontFamily" Value="Segoe UI, Segoe Fluent Icons, Segoe MDL2 Assets" />
    </Style>

    <Style x:Key="SettingContainerCurrentValueTextBlockStyle"
           BasedOn="{StaticResource SettingsPageItemDescriptionStyle}"
           TargetType="TextBlock">
        <Setter Property="MaxWidth" Value="248" />
        <Setter Property="Margin" Value="0,0,-16,0" />
        <Setter Property="HorizontalAlignment" Value="Right" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="FontFamily" Value="Segoe UI, Segoe Fluent Icons, Segoe MDL2 Assets" />
    </Style>

    <DataTemplate x:Key="ExpanderSettingContainerStringPreviewTemplate">
        <TextBlock Style="{StaticResource SettingContainerCurrentValueTextBlockStyle}"
                   Text="{Binding}" />
    </DataTemplate>

    <!--  A setting container for a setting that has no additional options  -->
    <Style TargetType="local:SettingContainer">
        <Setter Property="Margin" Value="0,4,0,0" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="MaxWidth" Value="1000" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:SettingContainer">
                    <Grid AutomationProperties.Name="{TemplateBinding Header}"
                          Style="{StaticResource NonExpanderGrid}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <StackPanel Grid.Column="0"
                                    Style="{StaticResource StackPanelInExpanderStyle}">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Style="{StaticResource SettingsPageItemHeaderStyle}"
                                           Text="{TemplateBinding Header}" />
                                <Button x:Name="ResetButton"
                                        Style="{StaticResource SettingContainerResetButtonStyle}">
                                    <FontIcon Glyph="&#xE845;"
                                              Style="{StaticResource SettingContainerFontIconStyle}" />
                                </Button>
                            </StackPanel>
                            <TextBlock x:Name="HelpTextBlock"
                                       Style="{StaticResource SettingsPageItemDescriptionStyle}"
                                       Text="{TemplateBinding HelpText}" />
                        </StackPanel>
                        <ContentPresenter Grid.Column="1"
                                          HorizontalAlignment="Right"
                                          VerticalAlignment="Center"
                                          Content="{TemplateBinding Content}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  A basic setting container displaying immutable text as content  -->
    <Style x:Key="SettingContainerWithTextContent"
           TargetType="local:SettingContainer">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:SettingContainer">
                    <Grid AutomationProperties.Name="{TemplateBinding Header}"
                          Style="{StaticResource NonExpanderGrid}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <StackPanel Grid.Column="0"
                                    Style="{StaticResource StackPanelInExpanderStyle}">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Style="{StaticResource SettingsPageItemHeaderStyle}"
                                           Text="{TemplateBinding Header}" />
                                <Button x:Name="ResetButton"
                                        Style="{StaticResource SettingContainerResetButtonStyle}">
                                    <FontIcon Glyph="&#xE845;"
                                              Style="{StaticResource SettingContainerFontIconStyle}" />
                                </Button>
                            </StackPanel>
                            <TextBlock x:Name="HelpTextBlock"
                                       Style="{StaticResource SettingsPageItemDescriptionStyle}"
                                       Text="{TemplateBinding HelpText}" />
                        </StackPanel>
                        <TextBlock Grid.Column="1"
                                   Margin="0,0,8,0"
                                   HorizontalAlignment="Right"
                                   VerticalAlignment="Center"
                                   Style="{ThemeResource SecondaryTextBlockStyle}"
                                   Text="{TemplateBinding Content}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--
        A setting container for a setting that has no additional options.
        Includes space for an icon on the left side of the header.
        XAML applies the margin/padding of the icon regardless of its
        existence (which caused inconsistent padding). It's easier to just create
        another style and move on.
    -->
    <Style x:Key="SettingContainerWithIcon"
           TargetType="local:SettingContainer">
        <Setter Property="Margin" Value="0,4,0,0" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="MaxWidth" Value="1000" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:SettingContainer">
                    <Grid AutomationProperties.Name="{TemplateBinding Header}"
                          Style="{StaticResource NonExpanderGrid}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <FontIcon Grid.Column="0"
                                  Glyph="{TemplateBinding FontIconGlyph}" />
                        <StackPanel Grid.Column="1"
                                    Padding="14,12,0,12"
                                    Style="{StaticResource StackPanelInExpanderStyle}">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Style="{StaticResource SettingsPageItemHeaderStyle}"
                                           Text="{TemplateBinding Header}" />
                                <Button x:Name="ResetButton"
                                        Style="{StaticResource SettingContainerResetButtonStyle}">
                                    <FontIcon Glyph="&#xE845;"
                                              Style="{StaticResource SettingContainerFontIconStyle}" />
                                </Button>
                            </StackPanel>
                            <TextBlock x:Name="HelpTextBlock"
                                       Style="{StaticResource SettingsPageItemDescriptionStyle}"
                                       Text="{TemplateBinding HelpText}" />
                        </StackPanel>
                        <ContentPresenter Grid.Column="2"
                                          HorizontalAlignment="Right"
                                          VerticalAlignment="Center"
                                          Content="{TemplateBinding Content}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  A setting container which can expand  -->
    <Style x:Key="ExpanderSettingContainerStyle"
           TargetType="local:SettingContainer">
        <Setter Property="MaxWidth" Value="1000" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="AutomationProperties.AccessibilityView" Value="Raw" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:SettingContainer">
                    <muxc:Expander x:Name="Expander"
                                   Margin="0,4,0,0"
                                   HorizontalAlignment="Stretch"
                                   HorizontalContentAlignment="Stretch"
                                   Content="{TemplateBinding Content}"
                                   IsExpanded="{TemplateBinding StartExpanded}">
                        <muxc:Expander.Header>
                            <Grid MinHeight="64">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <StackPanel Grid.Column="0"
                                            Style="{StaticResource StackPanelInExpanderStyle}">
                                    <StackPanel Orientation="Horizontal">
                                        <ContentPresenter Content="{TemplateBinding Header}" />
                                        <Button x:Name="ResetButton"
                                                Style="{StaticResource SettingContainerResetButtonStyle}">
                                            <FontIcon Glyph="&#xE845;"
                                                      Style="{StaticResource SettingContainerFontIconStyle}" />
                                        </Button>
                                    </StackPanel>
                                    <TextBlock x:Name="HelpTextBlock"
                                               Style="{StaticResource SettingsPageItemDescriptionStyle}"
                                               Text="{TemplateBinding HelpText}" />
                                </StackPanel>
                                <ContentPresenter Grid.Column="1"
                                                  Content="{TemplateBinding CurrentValue}"
                                                  ContentTemplate="{StaticResource ExpanderSettingContainerStringPreviewTemplate}" />
                            </Grid>
                        </muxc:Expander.Header>
                    </muxc:Expander>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--
        A setting container which can expand. Includes space for an icon on the left side of the header.
        XAML applies the margin/padding of the icon regardless of its
        existence (which caused inconsistent padding). It's easier to just create
        another style and move on.
    -->
    <Style x:Key="ExpanderSettingContainerStyleWithIcon"
           TargetType="local:SettingContainer">
        <Setter Property="MaxWidth" Value="1000" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="AutomationProperties.AccessibilityView" Value="Raw" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:SettingContainer">
                    <muxc:Expander x:Name="Expander"
                                   Margin="0,4,0,0"
                                   HorizontalAlignment="Stretch"
                                   HorizontalContentAlignment="Stretch"
                                   Content="{TemplateBinding Content}"
                                   IsExpanded="{TemplateBinding StartExpanded}">
                        <muxc:Expander.Header>
                            <Grid MinHeight="64">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <FontIcon Grid.Column="0"
                                          Glyph="{TemplateBinding FontIconGlyph}" />
                                <StackPanel Grid.Column="1"
                                            Padding="14,12,0,12"
                                            Style="{StaticResource StackPanelInExpanderStyle}">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Style="{StaticResource SettingsPageItemHeaderStyle}"
                                                   Text="{TemplateBinding Header}" />
                                        <Button x:Name="ResetButton"
                                                Style="{StaticResource SettingContainerResetButtonStyle}">
                                            <FontIcon Glyph="&#xE845;"
                                                      Style="{StaticResource SettingContainerFontIconStyle}" />
                                        </Button>
                                    </StackPanel>
                                    <TextBlock x:Name="HelpTextBlock"
                                               Style="{StaticResource SettingsPageItemDescriptionStyle}"
                                               Text="{TemplateBinding HelpText}" />
                                </StackPanel>
                                <ContentPresenter Grid.Column="2"
                                                  Content="{TemplateBinding CurrentValue}"
                                                  ContentTemplate="{StaticResource ExpanderSettingContainerStringPreviewTemplate}" />
                            </Grid>
                        </muxc:Expander.Header>
                    </muxc:Expander>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  A setting container which can expand. Supports data template override for preview  -->
    <Style x:Key="ExpanderSettingContainerStyleWithComplexPreview"
           TargetType="local:SettingContainer">
        <Setter Property="MaxWidth" Value="1000" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="AutomationProperties.AccessibilityView" Value="Raw" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:SettingContainer">
                    <muxc:Expander x:Name="Expander"
                                   Margin="0,4,0,0"
                                   HorizontalAlignment="Stretch"
                                   HorizontalContentAlignment="Stretch"
                                   Content="{TemplateBinding Content}"
                                   IsExpanded="{TemplateBinding StartExpanded}">
                        <muxc:Expander.Header>
                            <Grid MinHeight="64">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <StackPanel Grid.Column="0"
                                            Style="{StaticResource StackPanelInExpanderStyle}">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Style="{StaticResource SettingsPageItemHeaderStyle}"
                                                   Text="{TemplateBinding Header}" />
                                        <Button x:Name="ResetButton"
                                                Style="{StaticResource SettingContainerResetButtonStyle}">
                                            <FontIcon Glyph="&#xE845;"
                                                      Style="{StaticResource SettingContainerFontIconStyle}" />
                                        </Button>
                                    </StackPanel>
                                    <TextBlock x:Name="HelpTextBlock"
                                               Style="{StaticResource SettingsPageItemDescriptionStyle}"
                                               Text="{TemplateBinding HelpText}" />
                                </StackPanel>
                                <ContentPresenter Grid.Column="1"
                                                  MaxWidth="248"
                                                  Margin="0,0,-16,0"
                                                  HorizontalAlignment="Right"
                                                  VerticalAlignment="Center"
                                                  Content="{TemplateBinding CurrentValue}"
                                                  ContentTemplate="{TemplateBinding CurrentValueTemplate}" />
                            </Grid>
                        </muxc:Expander.Header>
                    </muxc:Expander>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  A setting container that displays a warning with an icon  -->
    <Style x:Key="SettingContainerWarningStyle"
           TargetType="local:SettingContainer">
        <Setter Property="Margin" Value="0,4,0,0" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="MaxWidth" Value="1000" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:SettingContainer">
                    <Grid AutomationProperties.Name="{TemplateBinding Header}"
                          Background="{ThemeResource SettingContainerWarningSeverityBackgroundBrush}"
                          Style="{StaticResource NonExpanderGrid}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <StackPanel Style="{StaticResource StackPanelInExpanderStyle}">
                            <StackPanel Orientation="Horizontal">
                                <Grid>
                                    <TextBlock x:Name="IconBackground"
                                               Grid.Column="0"
                                               Margin="{StaticResource SettingContainerIconMargin}"
                                               VerticalAlignment="Center"
                                               AutomationProperties.AccessibilityView="Raw"
                                               FontFamily="{ThemeResource SymbolThemeFontFamily}"
                                               FontSize="{StaticResource SettingContainerIconFontSize}"
                                               Foreground="{ThemeResource SettingContainerWarningSeverityIconBackground}"
                                               Text="{StaticResource SettingContainerIconBackgroundGlyph}" />

                                    <TextBlock x:Name="StandardIcon"
                                               Grid.Column="0"
                                               Margin="{StaticResource SettingContainerIconMargin}"
                                               VerticalAlignment="Center"
                                               FontFamily="{ThemeResource SymbolThemeFontFamily}"
                                               FontSize="{StaticResource SettingContainerIconFontSize}"
                                               Foreground="{ThemeResource SettingContainerWarningSeverityIconForeground}"
                                               Text="{StaticResource SettingContainerWarningIconGlyph}" />
                                </Grid>
                                <TextBlock VerticalAlignment="Center"
                                           FontWeight="{StaticResource SettingContainerTitleFontWeight}"
                                           Foreground="{ThemeResource SettingContainerTitleForeground}"
                                           Style="{StaticResource SettingsPageItemHeaderStyle}"
                                           Text="{TemplateBinding Header}" />
                            </StackPanel>
                            <TextBlock x:Name="HelpTextBlock"
                                       Foreground="{ThemeResource SettingContainerMessageForeground}"
                                       Style="{StaticResource SettingsPageItemDescriptionStyle}"
                                       Text="{TemplateBinding HelpText}" />
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  A setting container that displays an error with an icon  -->
    <Style x:Key="SettingContainerErrorStyle"
           TargetType="local:SettingContainer">
        <Setter Property="Margin" Value="0,4,0,0" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="MaxWidth" Value="1000" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:SettingContainer">
                    <Grid AutomationProperties.Name="{TemplateBinding Header}"
                          Background="{ThemeResource SettingContainerErrorSeverityBackgroundBrush}"
                          Style="{StaticResource NonExpanderGrid}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <StackPanel Style="{StaticResource StackPanelInExpanderStyle}">
                            <StackPanel Orientation="Horizontal">
                                <Grid>
                                    <TextBlock x:Name="IconBackground"
                                               Grid.Column="0"
                                               Margin="{StaticResource SettingContainerIconMargin}"
                                               VerticalAlignment="Center"
                                               AutomationProperties.AccessibilityView="Raw"
                                               FontFamily="{ThemeResource SymbolThemeFontFamily}"
                                               FontSize="{StaticResource SettingContainerIconFontSize}"
                                               Foreground="{ThemeResource SettingContainerErrorSeverityIconBackground}"
                                               Text="{StaticResource SettingContainerIconBackgroundGlyph}" />

                                    <TextBlock x:Name="StandardIcon"
                                               Grid.Column="0"
                                               Margin="{StaticResource SettingContainerIconMargin}"
                                               VerticalAlignment="Center"
                                               FontFamily="{ThemeResource SymbolThemeFontFamily}"
                                               FontSize="{StaticResource SettingContainerIconFontSize}"
                                               Foreground="{ThemeResource SettingContainerErrorSeverityIconForeground}"
                                               Text="{StaticResource SettingContainerErrorIconGlyph}" />
                                </Grid>
                                <TextBlock VerticalAlignment="Center"
                                           FontWeight="{StaticResource SettingContainerTitleFontWeight}"
                                           Foreground="{ThemeResource SettingContainerTitleForeground}"
                                           Style="{StaticResource SettingsPageItemHeaderStyle}"
                                           Text="{TemplateBinding Header}" />
                            </StackPanel>
                            <TextBlock x:Name="HelpTextBlock"
                                       Foreground="{ThemeResource SettingContainerMessageForeground}"
                                       Style="{StaticResource SettingsPageItemDescriptionStyle}"
                                       Text="{TemplateBinding HelpText}" />
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
