<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
                        ChildrenTransitions="{StaticResource SettingsCardsAnimations}"
                        Orientation="Vertical"
                        Spacing="{StaticResource SettingsCardSpacing}" />
                </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">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <TextBlock
                            x:Name="HeaderPresenter"
                            Grid.Row="0"
                            Margin="1,32,0,0"
                            AutomationProperties.HeadingLevel="Level2"
                            Style="{ThemeResource BodyStrongTextBlockStyle}"
                            Text="{TemplateBinding Header}" />

                        <ContentPresenter
                            x:Name="DescriptionPresenter"
                            Grid.Row="1"
                            Margin="1,0,0,0"
                            Content="{TemplateBinding Description}"
                            Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                            TextWrapping="WrapWholeWords">
                            <ContentPresenter.Resources>
                                <Style BasedOn="{StaticResource CaptionTextBlockStyle}" TargetType="TextBlock">
                                    <Style.Setters>
                                        <Setter Property="TextWrapping" Value="WrapWholeWords" />
                                    </Style.Setters>
                                </Style>
                                <Style BasedOn="{StaticResource TextButtonStyle}" TargetType="HyperlinkButton">
                                    <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" />
                        <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>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>