<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls">

    <Style TargetType="controls:Setting">
        <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}"/>
        <Setter Property="Background" Value="{ThemeResource CardBackgroundBrush}" />
        <Setter Property="BorderThickness" Value="{ThemeResource CardBorderThickness}" />
        <Setter Property="BorderBrush" Value="{ThemeResource CardStrokeColorDefaultBrush}" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="Padding" Value="16" />
        <Setter Property="Margin" Value="0,0,0,0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:Setting">
                    <Grid x:Name="RootGrid"
                          CornerRadius="{TemplateBinding CornerRadius}"
                          Background="{TemplateBinding Background}"
                          BorderThickness="{TemplateBinding BorderThickness}"
                          BorderBrush="{TemplateBinding BorderBrush}"
                          Padding="{TemplateBinding Padding}"
                          HorizontalAlignment="Stretch"
                          VerticalAlignment="Center"
                          MinHeight="48">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Disabled">
                                    <VisualState.Setters>
                                        <Setter Target="HeaderPresenter.Foreground" Value="{ThemeResource TextFillColorDisabledBrush}" />
                                        <Setter Target="DescriptionPresenter.Foreground" Value="{ThemeResource TextFillColorDisabledBrush}" />
                                        <Setter Target="IconPresenter.Foreground" Value="{ThemeResource TextFillColorDisabledBrush}" />
                                        <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TextFillColorDisabledBrush}" />
                                    </VisualState.Setters>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <!-- Icon -->
                            <ColumnDefinition Width="*"/>
                            <!-- Header and subtitle -->
                            <ColumnDefinition Width="Auto"/>
                            <!-- Action control -->
                        </Grid.ColumnDefinitions>

                        <ContentPresenter x:Name="IconPresenter"
                          Content="{TemplateBinding Icon}"
                          HorizontalAlignment="Center"
                          FontSize="20"
                          IsTextScaleFactorEnabled="False"
                          Margin="2,0,18,0"
                          MaxWidth="20"
                          AutomationProperties.AccessibilityView="Raw"
                          FontFamily="{ThemeResource SymbolThemeFontFamily}"
                          Foreground="{ThemeResource CardPrimaryForegroundBrush}"
                          VerticalAlignment="Center"/>

                        <StackPanel
                            VerticalAlignment="Center"
                            Grid.Column="1"
                            HorizontalAlignment="Stretch"
                            Margin="0,0,16,0">

                            <TextBlock
                                x:Name="HeaderPresenter"
                                Text="{TemplateBinding Header}"
                                VerticalAlignment="Center"
                                Foreground="{ThemeResource CardPrimaryForegroundBrush}" />

                            <ContentPresenter
                                x:Name="DescriptionPresenter"
                                Content="{TemplateBinding Description}"
                                FontSize="{StaticResource SecondaryTextFontSize}"
                                TextWrapping="WrapWholeWords"
                                Foreground="{ThemeResource TextFillColorSecondaryBrush}">
                                <ContentPresenter.Resources>
                                    <Style TargetType="TextBlock" BasedOn="{StaticResource CaptionTextBlockStyle}">
                                        <Style.Setters>
                                            <Setter Property="TextWrapping" Value="WrapWholeWords"/>
                                        </Style.Setters>
                                    </Style>
                                    <Style TargetType="HyperlinkButton" BasedOn="{StaticResource TextButtonStyle}">
                                        <Style.Setters>
                                            <Setter Property="FontSize" Value="12"/>
                                            <Setter Property="Padding" Value="0,0,0,0"/>
                                        </Style.Setters>
                                    </Style>
                                </ContentPresenter.Resources>
                            </ContentPresenter>
                        </StackPanel>

                        <ContentPresenter
                            x:Name="ContentPresenter"
                            Content="{TemplateBinding ActionContent}"
                            Grid.Column="2"
                            VerticalAlignment="Center"
                            HorizontalAlignment="Right" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>