<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:SettingsGroup">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Vertical"
                                Spacing="2"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:SettingsGroup">
                    <Grid HorizontalAlignment="Stretch">
                        <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}" />
                                    </VisualState.Setters>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <TextBlock x:Name="HeaderPresenter"
                                   Text="{TemplateBinding Header}"
                                   Grid.Row="0"
                                   Style="{ThemeResource BodyStrongTextBlockStyle}"
                                   Margin="1,32,0,0"
                                   AutomationProperties.HeadingLevel="Level2"/>

                        <ContentPresenter
                                x:Name="DescriptionPresenter"
                                Content="{TemplateBinding Description}"
                                TextWrapping="WrapWholeWords"
                                Margin="1,4,0,0"
                                Grid.Row="1"
                                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="Padding" Value="0,0,0,0"/>
                                    </Style.Setters>
                                </Style>
                            </ContentPresenter.Resources>
                        </ContentPresenter>
                        <ItemsPresenter Grid.Row="2" Margin="0,8,0,0"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>