<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Style x:Key="GridViewGroupStyle" TargetType="{x:Type GroupItem}">
        <Setter Property="Foreground" Value="{DynamicResource TextBrushDarker}" />
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="FontSize" Value="15" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type GroupItem}">
                    <ExpanderEx BorderThickness="0" SaveGameGroupId="{Binding Name, Mode=OneWay}"
                                IsExpanded="True" Background="Transparent" Padding="10">
                        <ExpanderEx.Header>                            
                            <DockPanel Background="Transparent">
                                <DockPanel.ContextMenu>
                                    <GameGroupMenu />
                                </DockPanel.ContextMenu>
                                <TextBlock DockPanel.Dock="Left"
                                           VerticalAlignment="Center" HorizontalAlignment="Left"
                                           TextAlignment="Center" Margin="0,0,5,0">
                                    <TextBlock.Style>
                                        <Style TargetType="TextBlock" BasedOn="{StaticResource BaseTextBlockStyle}">
                                            <Setter Property="Text" Value="{Binding Name, Converter={StaticResource ObjectToStringConverter}}" />
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding Name, Converter={StaticResource ObjectToStringConverter}}" Value="{x:Null}">
                                                    <Setter Property="Text" Value="{DynamicResource LOCNone}" />
                                                </DataTrigger>
                                                <DataTrigger Binding="{Binding Name, Converter={StaticResource ObjectToStringConverter}}" Value="">
                                                    <Setter Property="Text" Value="{DynamicResource LOCNone}" />
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </TextBlock.Style>
                                </TextBlock>
                                <TextBlock Text="{Binding Items.Count, Mode=OneWay, StringFormat=({0})}"
                                           VerticalAlignment="Center" HorizontalAlignment="Left"
                                           Style="{DynamicResource BaseTextBlockStyle}"
                                           DockPanel.Dock="Left" TextAlignment="Center"
                                           Visibility="{Settings ShowGroupCount}"/>
                            </DockPanel>
                        </ExpanderEx.Header>
                        <ItemsPresenter />
                    </ExpanderEx>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>