	  
	   
    
		

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c1="clr-namespace:C1.WPF;assembly=C1.WPF.4" xmlns:c1DataGrid="clr-namespace:C1.WPF.DataGrid" xmlns:c1DataGrid_Resources="clr-namespace:C1.Silverlight.DataGrid.Resources">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/C1.WPF.4;component/themes/Common.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!--******************** Grouping ********************-->

    <c1DataGrid_Resources:C1_Silverlight_DataGrid x:Key="DataGridResources" />
    <!--Use x:Key instead of x:Name to avoid blend issues-->

    <!-- Brush @ C1DataGrid GroupingPresenter Background -->
    
    
    <LinearGradientBrush x:Key="DataGridGroupingBrush" StartPoint="0.5,0" EndPoint="0.5,1">
        <GradientStop Color="#FFD1DCE8" />
    </LinearGradientBrush>

    <!-- CornerRadius @ C1DataGrid GroupingPresenter -->
    <CornerRadius x:Key="DataGridGroupingPresenterCornerRadius">0 0 0 0</CornerRadius>
    <!-- Thickness @ C1DataGrid GroupingPresenter -->
    <Thickness x:Key="DataGridGroupingPresenterThickness">0 0 0 1</Thickness>

    <!-- DataGridGroupingPresenter Style-->
    <Style TargetType="c1DataGrid:DataGridGroupingPresenter">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1DataGrid:DataGridGroupingPresenter">
                    <Grid x:Name="GroupingContent" Grid.ColumnSpan="2">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="GroupsStates">
                                <VisualState x:Name="Grouped">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Grouping" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Empty" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Ungrouped">
                                    <Storyboard />
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <c1:C1BrushBuilder x:Name="BackgroundBrush" Input="{TemplateBinding Background}" DesignBrush="{StaticResource DataGridGroupingBrush}" DesignColor="{StaticResource BaseColor}" />
                        <Border Background="{Binding ElementName=BackgroundBrush,Path=Output}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{StaticResource DataGridGroupingPresenterCornerRadius}" BorderThickness="{StaticResource DataGridGroupingPresenterThickness}" />
                        <Grid Margin="8">
                            <c1DataGrid:DataGridGroupingPanel x:Name="Grouping" Visibility="Collapsed" ColumnsHeaderGap="5" />
                            <TextBlock x:Name="Empty" Text="{Binding EmptyGroupPanel, Source={StaticResource DataGridResources}}" Opacity="0.7" TextTrimming="WordEllipsis" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
