<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:local="clr-namespace:CustomThemeBasedOnOfficeBlack_GridWpf;assembly=CustomThemeBasedOnOfficeBlack_GridWpf"
        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>
    

    <ControlTemplate x:Key="GridViewGroupPanelTemplate" TargetType="grid:GridViewGroupPanel">
        <Grid>
            <Border
					Background="{TemplateBinding Background}"  
					BorderBrush="{TemplateBinding BorderBrush}" 
					BorderThickness="{TemplateBinding BorderThickness}"
					Margin="{TemplateBinding Margin}">
                <TextBlock Text="Drag a Column Header and drop it here to group by that Column" TextWrapping="Wrap" 
						   Padding="{TemplateBinding Padding}" 
						   FontSize="{TemplateBinding FontSize}"
						   FontStyle="{TemplateBinding FontStyle}"
						   Foreground="{TemplateBinding Foreground}" 
						   HorizontalAlignment="Left" 
						   VerticalAlignment="Center"
					IsHitTestVisible="False" x:Name="panelText" />
            </Border>

            
            <WrapPanel>
                <ItemsPresenter Margin="10,6,10,0" />
            </WrapPanel>
            

            
        </Grid>
        
        <ControlTemplate.Triggers>
            <!--Grouping HasGroups State-->
            <Trigger Property="HasItems" Value="True">
                <Setter Property="Visibility" TargetName="panelText" Value="Collapsed"/>
            </Trigger>
        </ControlTemplate.Triggers>
        
    </ControlTemplate>

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

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

        TargetType="grid:GridViewGroupPanel">
        <Setter Property="Template" Value="{StaticResource GridViewGroupPanelTemplate}" />
        <Setter Property="ItemsPanel" Value="{StaticResource GridViewGroupPanelItemsPanelTemplate}" />

		<!--Sets the properties of the ALL GroupPanels-->
		<Setter Property="Margin" Value="0" />
		<Setter Property="Padding" Value="10,6,10,5" />
		<Setter Property="FontSize" Value="10" />
		<Setter Property="FontStyle" Value="Normal" />
	</Style>
    
</ResourceDictionary>