	  
	   
    
		

<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">
	<ResourceDictionary.MergedDictionaries>
		<ResourceDictionary Source="/C1.WPF.4;component/themes/Common.xaml" />
		<ResourceDictionary Source="/C1.WPF.DataGrid.4;component/themes/Common.xaml" />
	</ResourceDictionary.MergedDictionaries>

	<!--******************** Cell Presenter ********************-->

	<!-- Brush @ C1DataGrid Cell Border Focused -->
    
    
    <SolidColorBrush x:Key="DataGridCellFocusBrush" Color="#CC8ED1E2" />

	<!-- DataGridFocusPresenter Style -->
	<Style TargetType="c1DataGrid:DataGridFocusPresenter">
		<Setter Property="IsHitTestVisible" Value="false" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="c1DataGrid:DataGridFocusPresenter">
					<Grid>
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{StaticResource DataGridBorderThickness}" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- DataGridCellPresenter Style -->
	<Style TargetType="c1DataGrid:DataGridCellPresenter">
		<Setter Property="HorizontalContentAlignment" Value="Stretch" />
		<Setter Property="VerticalContentAlignment" Value="Stretch" />
		<!--This property must be set, else the HitTest method doesn't find the cell-->
		<Setter Property="Background" Value="Transparent" />
        <Setter Property="ValidationBackground" Value="{StaticResource ValidationBaseColorBrush}" />
        <Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="c1DataGrid:DataGridCellPresenter">
					<Grid>
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal" />
								<VisualState x:Name="Disabled" />
								<VisualState x:Name="MouseOver">
									<Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(UIElement.Opacity)">
											<DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" />
											<!--<EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>-->
											
											<LinearDoubleKeyFrame KeyTime="00:00:00" Value="1" />
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="SelectionStates">
								<VisualState x:Name="Unselected" />
								<VisualState x:Name="Editing" />
								<VisualState x:Name="Current">
									<Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusElement" Storyboard.TargetProperty="(UIElement.Opacity)" Duration="0">
											<DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" />
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="CurrentSelected">
									<Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusElement" Storyboard.TargetProperty="(UIElement.Opacity)" Duration="0">
											<DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" />
										</DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SelectedElement" Storyboard.TargetProperty="(UIElement.Opacity)" Duration="0">
											<DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" />
										</DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="CurrentSelectedElement" Storyboard.TargetProperty="(UIElement.Opacity)" Duration="0">
                                            <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
								</VisualState>
								<VisualState x:Name="Selected">
									<Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SelectedElement" Storyboard.TargetProperty="(UIElement.Opacity)" Duration="0">
											<DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" />
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="ValidationStates">
								<VisualState x:Name="Valid" />
								<VisualState x:Name="InvalidUnfocused">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Validation" Storyboard.TargetProperty="(UIElement.Opacity)" Duration="0">
											<DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" />
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="InvalidFocused">
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto" />
							<ColumnDefinition Width="*" />
							<ColumnDefinition Width="Auto" />
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto" />
							<RowDefinition Height="*" />
							<RowDefinition Height="Auto" />
						</Grid.RowDefinitions>
						<c1:C1BrushBuilder x:Name="SelectedBackground" Input="{TemplateBinding SelectedBackground}" DesignBrush="{StaticResource DataGridRowSelectedBackground}" DesignColor="{StaticResource SelectedColor}" />
                        <c1:C1BrushBuilder x:Name="CurrentSelectedBrush" Input="{TemplateBinding SelectedBackground}" DesignBrush="{StaticResource DataGridCellFocusBrush}" DesignColor="{StaticResource SelectedColor}" />
						<c1:C1BrushBuilder x:Name="MouseOverBrush" Input="{TemplateBinding MouseOverBrush}" DesignBrush="{StaticResource DataGridRowOverBrush}" DesignColor="{StaticResource MouseOverColor}" />                        
                        <Grid Background="{TemplateBinding Background}" Grid.Column="1" Grid.Row="1">
							<Border x:Name="SelectedElement" Background="{Binding ElementName=SelectedBackground,Path=Output}" Opacity="0" />
                            <Border x:Name="CurrentSelectedElement" Background="{Binding ElementName=CurrentSelectedBrush,Path=Output}" Opacity="0" />
							<c1DataGrid:DataGridFocusPresenter x:Name="FocusElement" BorderBrush="{TemplateBinding SelectedBackground}" Style="{TemplateBinding FocusStyle}" Opacity="0" />
							<Border x:Name="MouseOverElement" Background="{Binding ElementName=MouseOverBrush,Path=Output}" BorderBrush="{TemplateBinding SelectedBackground}" Opacity="0" />
							<ContentPresenter Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" />
							<Border x:Name="Validation" BorderBrush="{TemplateBinding ValidationBackground}" BorderThickness="1" Opacity="0" />
						</Grid>
						<Rectangle x:Name="LeftLine" Grid.Column="0" Grid.RowSpan="3" StrokeThickness="0" />
						<Rectangle x:Name="TopLine" Grid.Row="0" Grid.ColumnSpan="3" StrokeThickness="0" />
						<Rectangle x:Name="RightLine" Grid.Column="2" Grid.RowSpan="3" StrokeThickness="0" />
						<Rectangle x:Name="BottomLine" Grid.Row="2" Grid.ColumnSpan="3" StrokeThickness="0" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>
