<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:APKInstaller.Controls">
    <Style TargetType="controls:SettingsGroup">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <controls:StackPanel Orientation="Vertical" Spacing="2">
                        <controls:StackPanel.ChildrenTransitions>
                            <TransitionCollection>
                                <ReorderThemeTransition />
                            </TransitionCollection>
                        </controls:StackPanel.ChildrenTransitions>
                    </controls:StackPanel>
                </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" />
                        </Grid.RowDefinitions>
                        <ContentPresenter
                            x:Name="HeaderPresenter"
                            Grid.Row="0"
                            Margin="1,32,0,8"
                            AutomationProperties.HeadingLevel="Level2"
                            Content="{TemplateBinding Header}"
                            FontSize="{ThemeResource BodyStrongTextBlockFontSize}"
                            FontWeight="SemiBold"
                            HighContrastAdjustment="None"
                            LineStackingStrategy="MaxHeight"
                            TextLineBounds="Full"
                            TextWrapping="Wrap" />
                        <ItemsPresenter Grid.Row="1" />
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <VisualState.Setters>
                                        <Setter Target="HeaderPresenter.Foreground" Value="{ThemeResource TextFillColorDisabledBrush}" />
                                    </VisualState.Setters>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="HeaderVisibilityGroup">
                                <VisualState x:Name="HeaderVisible" />
                                <VisualState x:Name="HeaderCollapsed">
                                    <VisualState.Setters>
                                        <Setter Target="HeaderPresenter.Visibility" Value="Collapsed" />
                                    </VisualState.Setters>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
