<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib">

    <Thickness x:Key="GroupBoxPadding">0,0,0,15</Thickness>
    <sys:Double x:Key="GroupBoxHeaderFontSize">20</sys:Double>
    <Thickness x:Key="GroupBoxHeaderMargin">0,4,0,20</Thickness>

    <Style x:Key="DefaultGroupBoxStyle" TargetType="GroupBox">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}" />
        <Setter Property="Padding" Value="{DynamicResource GroupBoxPadding}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="GroupBox">
                    <Grid
                        Background="{TemplateBinding Background}"
                        SnapsToDevicePixels="true">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <ContentPresenter
                            Grid.Row="0"
                            TextElement.FontSize="{DynamicResource GroupBoxHeaderFontSize}"
                            Margin="{DynamicResource GroupBoxHeaderMargin}"
                            ContentSource="Header"
                            RecognizesAccessKey="True"
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        <ContentPresenter
                            Grid.Row="1"
                            Margin="{TemplateBinding Padding}"
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="GroupBox" BasedOn="{StaticResource DefaultGroupBoxStyle}" />
</ResourceDictionary>