	  
	   
    
		

<!--// Copyright © ComponentOne LLC.
// This file is part of ComponentOne Studio WPF Edition
// Please visit www.componentone.com for details
// All other rights reserved.
-->
<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:ms_silverlightonly="http://schemas.microsoft.com/client/2007" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="ms_silverlightonly">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/C1.WPF.4;component/themes/Common.xaml" />
        <ResourceDictionary Source="/C1.WPF.4;component/themes/C1ScrollBar.xaml" />
        <ResourceDictionary Source="/C1.WPF.DataGrid.4;component/themes/Common.xaml" />
        <ResourceDictionary Source="/C1.WPF.DataGrid.4;component/themes/DataGridCellPresenter.xaml" />
        <ResourceDictionary Source="/C1.WPF.DataGrid.4;component/themes/DataGridColumnHeaderPresenter.xaml" />
        <ResourceDictionary Source="/C1.WPF.DataGrid.4;component/themes/DataGridDetailsPresenter.xaml" />
        <ResourceDictionary Source="/C1.WPF.DataGrid.4;component/themes/DataGridDragNDrop.xaml" />
        <ResourceDictionary Source="/C1.WPF.DataGrid.4;component/themes/DataGridFilter.xaml" />
        <ResourceDictionary Source="/C1.WPF.DataGrid.4;component/themes/DataGridGroupingPresenter.xaml" />
        <ResourceDictionary Source="/C1.WPF.DataGrid.4;component/themes/DataGridRowHeaderPresenter.xaml" />
        <ResourceDictionary Source="/C1.WPF.DataGrid.4;component/themes/DataGridRowPresenter.xaml" />
        <ResourceDictionary Source="/C1.WPF.DataGrid.4;component/themes/DataGridVerticalFreezingSeparatorPresenter.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!--******************** C1DataGrid *********************-->
    
    <!-- C1DataGrid Style -->
    <Style TargetType="c1DataGrid:C1DataGrid">
        
        
        <Setter Property="BorderBrush" Value="{StaticResource WpfInputDataGridBorderBrush}" />
        <Setter Property="HorizontalGridLinesBrush" Value="{StaticResource WpfInputDataGridLinesBrush}" />
        <Setter Property="VerticalGridLinesBrush" Value="{StaticResource WpfInputDataGridLinesBrush}" />
        <Setter Property="SelectedBackground" Value="{StaticResource WpfInputSelectedBackground}" />
        <Setter Property="PressedBrush" Value="{StaticResource WpfInputDataGridSelectedBackground}" />
        <Setter Property="MouseOverBrush" Value="{StaticResource WpfInputDataGridMouseOverBrush}" />
        <Setter Property="GroupingPanelBackground" Value="{StaticResource WpfInputBaseBrush}" />
        <Setter Property="HeaderBackground" Value="{StaticResource WpfInputBaseBrush}" />
        <Setter Property="Background" Value="{StaticResource DataGridMainPanelBrush}" />
        <Setter Property="Foreground" Value="{StaticResource DataGridForeground}" />
        <Setter Property="RowBackground" Value="{StaticResource DataGridRowBrush}" />
        <Setter Property="AlternatingRowForeground" Value="{StaticResource DataGridAlternatingRowForeground}" />
        <Setter Property="AlternatingRowBackground" Value="{StaticResource DataGridAlternatingRowBrush}" />
        <Setter Property="RowForeground" Value="{StaticResource DataGridRowForeground}" />
        <Setter Property="DragSourceColumnStyle" Value="{StaticResource DataGridDragNDropSelectedHeaderStyle}" />
        <Setter Property="DragOverColumnStyle" Value="{StaticResource DataGridDragNDropMovingHeader}" />
        <Setter Property="DropIndicatorStyle" Value="{StaticResource DataGridDragNDropDropIndicator}" />
        <Setter Property="BorderThickness" Value="{StaticResource DataGridBorderThickness}" />
        <Setter Property="ScrollBarStyle" Value="{StaticResource ScrollBarClearStyle}" />
        <Setter Property="ValidationBackground" Value="{StaticResource ValidationBaseColorBrush}" />
        <Setter Property="ValidationForeground" Value="{StaticResource ValidationForegroundBrush}" />        
        <Setter Property="HeaderForeground" Value="{StaticResource DataGridForeground}" />        
        <Setter Property="GroupingPanelForeground" Value="{StaticResource DataGridForeground}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1DataGrid:C1DataGrid">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="{StaticResource DataGridCornerRadius}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <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>
                                <VisualState x:Name="ReadOnly">
                                    <Storyboard />
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="LoadingStates">
                                <VisualState x:Name="Ready" />
                                <VisualState x:Name="Loading">
                                    <Storyboard>
                                        
                                        
                                        <BooleanAnimationUsingKeyFrames Storyboard.TargetName="LoadingBackground" Storyboard.TargetProperty="IsActive" Duration="0">
                                            <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True" />
                                        </BooleanAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <!-- main grid -->
                        <Grid>
                            <Grid x:Name="GridControl">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Grid.Resources>
                                    <ControlTemplate x:Key="TopLeftCornerTemplate" TargetType="Button">
                                        <Grid x:Name="RootElement">
                                            <VisualStateManager.VisualStateGroups>
                                                <VisualStateGroup x:Name="CommonStates">
                                                    <VisualState x:Name="Normal" />
                                                    <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>
                                                    <VisualState x:Name="Pressed">
                                                        <Storyboard>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Disabled">
                                                        <Storyboard>
                                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                                                                <!--<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>-->
                                                                
                                                                <LinearDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                                                            </DoubleAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                </VisualStateGroup>
                                                <VisualStateGroup x:Name="FocusStates">
                                                    <VisualState x:Name="Focused" />
                                                    <VisualState x:Name="Unfocused" />
                                                </VisualStateGroup>
                                            </VisualStateManager.VisualStateGroups>
                                            <c1:C1BrushBuilder x:Name="TopLeftCornerBackgroundBrush" Input="{TemplateBinding Background}" DesignBrush="{StaticResource DataGridTopLeftCornerBrush}" DesignColor="{StaticResource BaseColor}" />
                                            <c1:C1BrushBuilder x:Name="TopLeftCornerOverBrush" Input="{TemplateBinding c1:ClearStyleExtensions.MouseOverBrush}" DesignBrush="{StaticResource DataGridTopLeftCornerOverBrush}" DesignColor="{StaticResource MouseOverColor}" />
                                            <Border Background="{Binding Output, ElementName=TopLeftCornerBackgroundBrush}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{StaticResource DataGridTopLeftCornerRadius}" BorderThickness="{StaticResource DataGridTopLeftBorderThickness}" />
                                            <Border x:Name="MouseOverElement" Background="{Binding Output, ElementName=TopLeftCornerOverBrush}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{StaticResource DataGridTopLeftCornerRadius}" BorderThickness="{StaticResource DataGridTopLeftBorderThickness}" Visibility="Collapsed" />
                                            <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="3" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
                                        </Grid>
                                    </ControlTemplate>
                                </Grid.Resources>
                                <c1:C1BrushBuilder x:Name="BottomRightCornerBackgroundBrush" Input="{TemplateBinding HeaderBackground}" DesignBrush="{StaticResource DataGridBottomRightCornerBrush}" DesignColor="{StaticResource BaseColor}" />

                                <!--BottomRightCorner-->
                                <Grid x:Name="BottomRightCorner" Grid.Row="2" Grid.Column="1">
                                    <Border x:Name="BackgroundElement" Background="{Binding Output, ElementName=BottomRightCornerBackgroundBrush}" CornerRadius="{StaticResource DataGridBottomRightCornerRadius}" />
                                </Grid>

                                <!--Grouping-->
                                <c1DataGrid:DataGridGroupingPresenter x:Name="Grouping" Grid.ColumnSpan="2" BorderThickness="0,0,2,1" />
                                
                                <Border x:Name="GridContent" Grid.Row="1" CornerRadius="{StaticResource DataGridTopLeftCornerRadius}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}">
                                    <Grid x:Name="Root">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="*" />
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="*" />
                                        </Grid.ColumnDefinitions>

                                        <!-- corners -->
                                        <Button x:Name="TopLeftCorner" Template="{StaticResource TopLeftCornerTemplate}" Background="{TemplateBinding HeaderBackground}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}">
                                            <Path Data="M10,0 L10,10 L0,10 z" Stretch="None" Height="10" Width="10" Fill="{TemplateBinding Foreground}" Opacity="0.3" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
                                        </Button>

                                        <!-- column headers -->
                                        <c1DataGrid:DataGridColumnsHeaderPanel x:Name="ColumnsHeader" Grid.Column="1" MinHeight="16" Background="{TemplateBinding HeaderBackground}" />

                                        <!-- data area -->
                                        <c1DataGrid:DataGridRowsPanel x:Name="Body" Grid.Column="1" Grid.Row="1" Background="{TemplateBinding Background}" />

                                        <!-- row headers -->
                                        <c1DataGrid:DataGridRowsHeaderPanel x:Name="RowsHeader" Grid.Row="1" Background="{TemplateBinding HeaderBackground}" />
                                        <!--MinWidth="16"-->
                                    </Grid>
                                </Border>
                                <!-- scrollbars -->
                                <Border x:Name="Border_HorizontalScrollBar" Grid.Row="2">
                                    <ScrollBar x:Name="HorizontalScrollBar" Orientation="Horizontal" Height="Auto" Background="{TemplateBinding HeaderBackground}" Foreground="{TemplateBinding HeaderForeground}" BorderBrush="{TemplateBinding BorderBrush}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" Style="{TemplateBinding ScrollBarStyle}" Visibility="Collapsed" />
                                </Border>
                                <Border x:Name="Border_VerticalScrollBar" Grid.Column="1" Grid.Row="1">
                                    <ScrollBar x:Name="VerticalScrollBar" Orientation="Vertical" Width="Auto" Background="{TemplateBinding HeaderBackground}" Foreground="{TemplateBinding HeaderForeground}" BorderBrush="{TemplateBinding BorderBrush}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" Style="{TemplateBinding ScrollBarStyle}" Visibility="Collapsed" />
                                </Border>
                                <!-- Popup -->
                                <Popup x:Name="Popup" />
                            </Grid>
                            <c1:C1ProgressIndicator x:Name="LoadingBackground" IsActive="False" Style="{Binding LoadingIndicatorStyle, RelativeSource={RelativeSource TemplatedParent}}" />
                            <Border x:Name="DisabledVisualElement" Background="{StaticResource DisabledBrush}" CornerRadius="{StaticResource DataGridGeneralCornerRadius}" IsHitTestVisible="False" Visibility="Collapsed" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
