<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:local="clr-namespace:CustomTheme;assembly=CustomTheme"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
         
    xmlns:grid="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"
        xmlns:controls="clr-namespace:Telerik.Windows.Controls"
    
     >
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Resources.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <telerik:InvertedBooleanToVisibilityConverter x:Key="invertedBooleanConverter" />

    <ControlTemplate x:Key="GridViewGroupPanelTemplate" TargetType="grid:GridViewGroupPanel">
        <Grid>
            <Border Height="Auto" Background="{TemplateBinding Background}" 
					BorderBrush="{TemplateBinding BorderBrush}" 
					BorderThickness="{TemplateBinding BorderThickness}"
					Margin="{TemplateBinding Margin}"
					SnapsToDevicePixels="True"  >

                <TextBlock x:Name="panelText"
						   Padding="{TemplateBinding Padding}"
						   FontSize="{TemplateBinding FontSize}" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="Left"
						   FontStyle="{TemplateBinding FontStyle}"
						   VerticalAlignment="Center"
                           Text="Drag a Column Header and drop it here to group by that Column"
							IsHitTestVisible="False"   Visibility="{TemplateBinding HasItems, Converter={StaticResource invertedBooleanConverter}}"  />
            </Border>

            <WrapPanel>

                <ItemsPresenter Margin="10,9,10,0" />

            </WrapPanel>



        </Grid>
    </ControlTemplate>

    <ItemsPanelTemplate x:Key="GridViewGroupPanelItemsPanelTemplate">
        <StackPanel Orientation="Horizontal" VerticalAlignment="Stretch" />
    </ItemsPanelTemplate>

    <Style 
        
        x:Key="{telerik:ThemeResourceKey ThemeType=local:MyCustomTheme, ElementType=grid:GridViewGroupPanel}"
        

        TargetType="grid:GridViewGroupPanel">
        <Setter Property="Template" Value="{StaticResource GridViewGroupPanelTemplate}" />
        <Setter Property="ItemsPanel" Value="{StaticResource GridViewGroupPanelItemsPanelTemplate}" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="FontSize" Value="10" />
        <Setter Property="FontStyle" Value="Normal" />
        <Setter Property="Padding" Value="10,5,0,4" />
    </Style>

</ResourceDictionary>