	  
	   
    
		

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:system="clr-namespace:System;assembly=mscorlib" xmlns:c1="clr-namespace:C1.WPF;assembly=C1.WPF.4" xmlns:c1DataGrid="clr-namespace:C1.WPF.DataGrid" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/C1.WPF.4;component/themes/Common.xaml" />
        <ResourceDictionary Source="/C1.WPF.4;component/themes/C1ValidationDecorator.xaml" />
        <ResourceDictionary Source="/C1.WPF.DataGrid.4;component/themes/Common.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!--******************** RowHeader Presenter *******************-->

    <!-- Brush @ C1DataGrid RowHeader Background -->
    
    
    <SolidColorBrush x:Key="DataGridRowHeaderBrush" Color="{StaticResource BaseColor}" />
    <SolidColorBrush x:Key="DataGridRowHeaderOverBrush" Color="{StaticResource MouseOverColor}" />
    <SolidColorBrush x:Key="DataGridRowHeaderSelectedBackground" Color="{StaticResource SelectedColor}" />

    <!-- Style @ C1DataGrid RowHeader View Detail Arrow -->
    <Style x:Key="DataGridRowHeaderViewDetailArrowStyle" TargetType="Path">
        <Setter Property="Height" Value="3" />
        <Setter Property="Width" Value="6" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="HorizontalAlignment" Value="Center" />
    </Style>

    <!-- Styles @ DataGrid Icon Edit Pen -->
    <Style x:Key="DataGridRowHeaderIconEditLine" TargetType="Rectangle">
        <Setter Property="Stroke" Value="{x:Null}" />
        <Setter Property="Fill" Value="#FF6E6D6B" />
        <Setter Property="Grid.Column" Value="3" />
        <Setter Property="Grid.Row" Value="4" />
    </Style>
    <Style x:Key="DataGridRowHeaderIconEditRubber" TargetType="Path">
        <Setter Property="Stroke">
            <Setter.Value>
                <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                    <GradientStop Color="#FF7BAAD2" Offset="0.5" />
                    <GradientStop Color="#FF6D9CBD" Offset="0.5" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="StrokeThickness" Value="0.5" />
        <Setter Property="Fill">
            <Setter.Value>
                <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                    <GradientStop Color="#FFD0885E" />
                    <GradientStop Color="#FFC5442A" Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Grid.Column" Value="1" />
        <Setter Property="Grid.Row" Value="1" />
    </Style>
    
    
    <Style x:Key="DataGridRowHeaderIconEditBody" TargetType="Border">
        <Setter Property="BorderBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                    <GradientStop Color="#FF8E8E8E" Offset="0.5" />
                    <GradientStop Color="#FF737373" Offset="0.5" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderThickness" Value="1,0,1,0" />
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                    <GradientStop Color="#FF979797" Offset="0.5" />
                    <GradientStop Color="#FF878787" Offset="0.5" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Grid.Column" Value="1" />
        <Setter Property="Grid.Row" Value="2" />
    </Style>
    <Style x:Key="DataGridRowHeaderIconEditSharp" TargetType="Polygon">
        <Setter Property="Fill">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFFFFFFF" />
                    <GradientStop Color="#FFFFFFFF" Offset="0.66" />
                    <GradientStop Color="#FF6E6D6B" Offset="0.66" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Grid.Column" Value="1" />
        <Setter Property="Grid.Row" Value="3" />
        <Setter Property="Grid.RowSpan" Value="2" />
    </Style>

    <!-- Hide/Show Details ToggleButton @ C1DataGrid RowHeader -->
    <Style x:Key="DataGridRowHeaderViewDetailTButtonStyle" TargetType="ToggleButton">
        <Setter Property="Height" Value="14" />
        <Setter Property="Width" Value="14" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid Visibility="Visible">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(UIElement.Opacity)" Duration="0">
                                            <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FilterArrowExpand" Storyboard.TargetProperty="(UIElement.Opacity)" Duration="0">
                                            <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(UIElement.Opacity)" Duration="0">
                                            <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FilterArrowExpand" Storyboard.TargetProperty="(UIElement.Opacity)" Duration="0">
                                            <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="FilterArrowExpand" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="-1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="MouseOverElement" Background="{TemplateBinding Background}" BorderThickness="1 0 1 1" BorderBrush="{TemplateBinding BorderBrush}" Opacity="0" />
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="contentPresenter" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
                        <Path x:Name="FilterArrowExpand" Data="M0,0 L8,0 L4,4 L4,4 z" Fill="{TemplateBinding Foreground}" Style="{StaticResource DataGridRowHeaderViewDetailArrowStyle}" Opacity="0.5" RenderTransformOrigin="0.5,0.5" Height="4" Width="8" Stretch="None">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform />
                                    <SkewTransform />
                                    <RotateTransform />
                                    <TranslateTransform />
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                        <Border x:Name="DisabledVisualElement" Background="{StaticResource DisabledBrush}" IsHitTestVisible="False" Visibility="Collapsed" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- DataGridRowHeaderPresenter Style -->
    <Style TargetType="c1DataGrid:DataGridRowHeaderPresenter">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="BorderThickness" Value="0 0 1 1" />
        <Setter Property="ValidationBackground" Value="{StaticResource ValidationBaseColorBrush}" />
        <Setter Property="ValidationForeground" Value="{StaticResource ValidationForegroundBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1DataGrid:DataGridRowHeaderPresenter">
                    <Grid x:Name="RootElement">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SelectedElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Editing">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EditingElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SelectedElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ToggleDetails" 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="Unselected">
                                    <Storyboard />
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Validation" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InvalidFocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="MergingStates">
                                <VisualState x:Name="Merging">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundBrush" Storyboard.TargetProperty="DesignBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DataGridColumnHeaderMergingBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOverBrush" Storyboard.TargetProperty="DesignBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DataGridColumnHeaderMergingOverBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SelectedBackground" Storyboard.TargetProperty="DesignBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DataGridColumnHeaderMergingSelectedBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="NotMerging" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <c1:C1BrushBuilder x:Name="BackgroundBrush" Input="{TemplateBinding Background}" DesignBrush="{StaticResource DataGridRowHeaderBrush}" DesignColor="{StaticResource BaseColor}" />
                        <c1:C1BrushBuilder x:Name="MouseOverBrush" Input="{TemplateBinding MouseOverBrush}" DesignBrush="{StaticResource DataGridRowHeaderOverBrush}" DesignColor="{StaticResource MouseOverColor}" />
                        <c1:C1BrushBuilder x:Name="SelectedBackground" Input="{TemplateBinding SelectedBackground}" DesignBrush="{StaticResource DataGridRowHeaderSelectedBackground}" DesignColor="{StaticResource SelectedColor}" />
                        <c1:C1BrushBuilder x:Name="ValidationBackground" Input="{TemplateBinding ValidationBackground}" DesignBrush="{StaticResource ValidationBackgroundBrush}" DesignColor="{StaticResource ValidationBaseColor}" />
                        <Border Background="{Binding Output, ElementName=BackgroundBrush}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" />
                        <Border x:Name="SelectedElement" Background="{Binding Output, ElementName=SelectedBackground}" BorderThickness="{TemplateBinding BorderThickness}" Visibility="Collapsed" />
                        <Border x:Name="MouseOverElement" Background="{Binding Output, ElementName=MouseOverBrush}" BorderThickness="{TemplateBinding BorderThickness}" Visibility="Collapsed" />
                        <ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        <Grid x:Name="EditingElement" Visibility="Collapsed">
                            <Grid.RowDefinitions>
                                <RowDefinition />
                                <RowDefinition Height="Auto" />
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <Grid x:Name="ico_edit" Height="14" Width="14" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Left">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="1" />
                                    <RowDefinition Height="3" />
                                    <RowDefinition Height="5" />
                                    <RowDefinition Height="2" />
                                    <RowDefinition Height="1*" />
                                    <RowDefinition Height="2" />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="2" />
                                    <ColumnDefinition Width="4" />
                                    <ColumnDefinition Width="1" />
                                    <ColumnDefinition Width="6" />
                                    <ColumnDefinition Width="1" />
                                </Grid.ColumnDefinitions>
                                <Rectangle x:Name="line" Style="{StaticResource DataGridRowHeaderIconEditLine}" />
                                <Path x:Name="rubber" Data="M2,0 C3.1045694,0 4,0.67157286 4,1.5 C4,1.6682743 4,2 4,2 L4,3 L2,3 L0,3 L0,2 C0,2 0,1.6682743 0,1.5 C0,0.67157286 0.89543051,0 2,0 z" Style="{StaticResource DataGridRowHeaderIconEditRubber}" />
                                <Border x:Name="body" Style="{StaticResource DataGridRowHeaderIconEditBody}" />
                                <Polygon x:Name="sharp" Points="0,0 4,0 2,3" Style="{StaticResource DataGridRowHeaderIconEditSharp}" />
                            </Grid>
                        </Grid>
                        <Grid x:Name="ValidationContainer">
                            <Grid x:Name="Validation" Height="12" Width="12" Visibility="Collapsed">
                                <Ellipse Fill="{Binding Output, ElementName=ValidationBackground}">
                                    <ToolTipService.ToolTip>
                                        <ToolTip x:Name="validationTooltip" Placement="Right" Background="{TemplateBinding ValidationBackground}" Foreground="{TemplateBinding ValidationForeground}" Style="{StaticResource ValidationToolTipStyle}">
                                            <ItemsControl ItemsSource="{Binding ValidationResults, RelativeSource={RelativeSource TemplatedParent}}">
                                                <ItemsControl.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Margin="8,4,8,4" MaxWidth="250" TextWrapping="Wrap" Text="{Binding ErrorMessage}" />
                                                    </DataTemplate>
                                                </ItemsControl.ItemTemplate>
                                            </ItemsControl>
                                        </ToolTip>
                                    </ToolTipService.ToolTip>
                                </Ellipse>
                                <Path Stretch="Fill" Width="2" Height="8" Fill="{TemplateBinding ValidationForeground}" HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False" Data="M1.128,10.6 L3.3,10.6 L3.3,12 L1.128,12 z M1.1,4 L3.335,4 L3.09,9.7 L1.337,9.7 z" />
                            </Grid>
                        </Grid>
                        <ToggleButton x:Name="ToggleDetails" Style="{StaticResource DataGridRowHeaderViewDetailTButtonStyle}" Background="{Binding Output, ElementName=MouseOverBrush}" BorderBrush="{TemplateBinding BorderBrush}" Foreground="{TemplateBinding Foreground}" IsTabStop="False" Margin="0" HorizontalAlignment="Right" VerticalAlignment="Top" />
                        <Rectangle x:Name="Resize" Fill="White" Height="4" Grid.ColumnSpan="3" Grid.RowSpan="3" VerticalAlignment="Bottom" Cursor="SizeNS" Opacity="0" Margin="0,0,0,-2" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!--******************** New RowHeader Presenter ********************-->

    <!-- Style @ C1DataGrid NewRowHeader Icon -->
    <Style x:Key="DataGridNewRowHeaderIcon" TargetType="TextBlock">
        <Setter Property="FontFamily" Value="Arial" />
        <Setter Property="FontSize" Value="18" />
        <Setter Property="TextAlignment" Value="Center" />
        <Setter Property="Text" Value="*" />
        <Setter Property="FontWeight" Value="Normal" />
        <Setter Property="TextWrapping" Value="Wrap" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="Height" Value="14" />
        <Setter Property="Opacity" Value="1" />
    </Style>

    <!-- DataGridNewRowHeaderPresenter Style -->
    <Style TargetType="c1DataGrid:DataGridNewRowHeaderPresenter">
        <Setter Property="BorderThickness" Value="0 0 1 1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1DataGrid:DataGridNewRowHeaderPresenter">
                    <Grid x:Name="RootElement">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SelectedElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Editing">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SelectedElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unselected">
                                    <Storyboard />
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Validation" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InvalidFocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="MergingStates">
                                <VisualState x:Name="Merging">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundBrush" Storyboard.TargetProperty="DesignBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DataGridColumnHeaderMergingBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOverBrush" Storyboard.TargetProperty="DesignBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DataGridColumnHeaderMergingOverBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SelectedBackground" Storyboard.TargetProperty="DesignBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DataGridColumnHeaderMergingSelectedBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="NotMerging" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <c1:C1BrushBuilder x:Name="BackgroundBrush" Input="{TemplateBinding Background}" DesignBrush="{StaticResource DataGridRowHeaderBrush}" DesignColor="{StaticResource BaseColor}" />
                        <c1:C1BrushBuilder x:Name="MouseOverBrush" Input="{TemplateBinding MouseOverBrush}" DesignBrush="{StaticResource DataGridRowHeaderOverBrush}" DesignColor="{StaticResource MouseOverColor}" />
                        <c1:C1BrushBuilder x:Name="SelectedBackground" Input="{TemplateBinding SelectedBackground}" DesignBrush="{StaticResource DataGridRowHeaderSelectedBackground}" DesignColor="{StaticResource SelectedColor}" />
                        <c1:C1BrushBuilder x:Name="ValidationBackground" Input="{TemplateBinding ValidationBackground}" DesignBrush="{StaticResource ValidationBackgroundBrush}" DesignColor="{StaticResource ValidationBaseColor}" />
                        <Border Background="{Binding Output, ElementName=BackgroundBrush}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" />
                        <Border x:Name="MouseOverElement" Background="{Binding Output, ElementName=MouseOverBrush}" BorderThickness="{TemplateBinding BorderThickness}" Visibility="Collapsed" />
                        <Border x:Name="SelectedElement" Background="{Binding Output, ElementName=SelectedBackground}" BorderThickness="{TemplateBinding BorderThickness}" Visibility="Collapsed" />
                        <TextBlock x:Name="Icon" Style="{StaticResource DataGridNewRowHeaderIcon}" FontWeight="Normal" HorizontalAlignment="Center" />
                        <Grid x:Name="Validation" Height="12" Width="12" Visibility="Collapsed">
                            <Ellipse Fill="{Binding Output, ElementName=ValidationBackground}">
                                <ToolTipService.ToolTip>
                                    <ToolTip x:Name="validationTooltip" Placement="Right" Background="{TemplateBinding ValidationBackground}" Foreground="{TemplateBinding ValidationForeground}" Style="{StaticResource ValidationToolTipStyle}">
                                        <ItemsControl ItemsSource="{Binding ValidationResults, RelativeSource={RelativeSource TemplatedParent}}">
                                            <ItemsControl.ItemTemplate>
                                                <DataTemplate>
                                                    <TextBlock Margin="8,4,8,4" MaxWidth="250" TextWrapping="Wrap" Text="{Binding ErrorMessage}" />
                                                </DataTemplate>
                                            </ItemsControl.ItemTemplate>
                                        </ItemsControl>
                                    </ToolTip>
                                </ToolTipService.ToolTip>
                            </Ellipse>
                            <Path Stretch="Fill" Width="2" Height="8" Fill="{TemplateBinding ValidationForeground}" HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False" Data="M1.128,10.6 L3.3,10.6 L3.3,12 L1.128,12 z M1.1,4 L3.335,4 L3.09,9.7 L1.337,9.7 z" />
                        </Grid>
                        <Rectangle x:Name="Resize" Fill="White" Height="4" Grid.ColumnSpan="3" Grid.RowSpan="3" VerticalAlignment="Bottom" Cursor="SizeNS" Opacity="0" Margin="0,0,0,-2" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
