	  
	   
    
		

<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:c1Ext="clr-namespace:C1.WPF.Extended" xmlns:c1ExtPG="clr-namespace:C1.WPF.Extended.PropertyGrid" xmlns:c1Ext_Resources="clr-namespace:C1.Silverlight.Resources">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/C1.WPF.4;component/themes/Common.xaml" />
        <ResourceDictionary Source="/C1.WPF.4;component/themes/C1ScrollBar.xaml" />
        <ResourceDictionary Source="/C1.WPF.4;component/themes/C1Button.xaml" />
        <ResourceDictionary Source="/C1.WPF.4;component/themes/C1Window.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!--******************* PropertyGrid ********************-->

    <c1Ext_Resources:C1_Silverlight_Extended x:Key="ExtResources" />

    <!-- Brush @ PropertyGrid Background -->
    <SolidColorBrush x:Key="PropGridBackground" Color="White" />
    <!-- Brush @ PropertyGrid Border -->
    <SolidColorBrush x:Key="PropGridBorderBrush" Color="#FF8396A8" />

    <!-- CornerRadius @ PropertyGrid -->
    <CornerRadius x:Key="PropGridCornerRadius">0</CornerRadius>
    <CornerRadius x:Key="PropGridExpanderCornerRadius">0</CornerRadius>

    <!-- Thickness @ PropertyGrid -->
    <Thickness x:Key="PropGridThickness">1</Thickness>

    <!-- Brush @ PropertyGrid ResetButton Border -->
    <SolidColorBrush x:Key="PropGridResetButtonBorderBrush" Color="#FFA3AEB7" />

    <!-- Brush @ PropertyBox Label Background & Border -->
    
    
    <SolidColorBrush x:Key="PropBoxLabelBrush" Color="#FFF4FAFA" />
    <SolidColorBrush x:Key="PropBoxBorderBrush" Color="#FFDCDCDC" />
    <!-- Brush @ PropertyBox Editor Background -->
    <SolidColorBrush x:Key="PropBoxEditorBrush" Color="#FFFFFFFF" />

    <!-- Brush @ PropertyGrid Description Background -->
    <SolidColorBrush x:Key="PropGridDescriptionBrush" Color="#FFE2E8EE" />
    <!-- Brush @ PropertyGrid Description Border -->

    <!--CollectionEditorControl @ C1PropertyGrid -->
    <Style TargetType="c1ExtPG:CollectionEditorControl">
        
        
        <Setter Property="BorderBrush" Value="{StaticResource WpfInputBorderBrush}" />
        <Setter Property="Background" Value="{StaticResource PropGridBackground}" />
        <Setter Property="BorderThickness" Value="{StaticResource GeneralThickness}" />
        <Setter Property="Foreground" Value="{StaticResource ForegroundBrushColor}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1ExtPG:CollectionEditorControl">
                    <Grid Margin="10">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition MinWidth="195" />
                            <ColumnDefinition Width="10" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Border Background="#19000000" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0 1 0 0" Grid.Row="2" Grid.ColumnSpan="3" Margin="-10,0,-10,-10" Opacity="0.5" />
                        <TextBlock Text="{Binding Path=CollectionEditorControl_Items, Source={StaticResource ExtResources}}" />
                        <Grid Grid.Row="1" Margin="0,0,0,5">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Grid Margin="0 5">
                                <Border x:Name="Background" Background="{TemplateBinding Background}" />
                                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                                    <ListBox x:Name="ItemsSelector" Background="Transparent" BorderThickness="0" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" />
                                </Border>
                            </Grid>
                            <StackPanel Orientation="Horizontal" Grid.Row="1">
                                <Button x:Name="RemoveButton" MinHeight="24" MinWidth="24" ToolTipService.ToolTip="{Binding Path=CollectionEditorControl_Remove, Source={StaticResource ExtResources}}" IsEnabled="{TemplateBinding CanUserRemoveItems}">
                                    <Path Fill="{TemplateBinding Foreground}" Stretch="None" Data="M1.4,0 L5,3.5 L8.5,9.5E-06 L10,1.4 L6.4,5 L10,8.5 L8.5,10 L5,6.4 L1.4,10 L9.5E-07,8.5 L3.5,5 L0,1.4 z" Width="10" Height="10" />
                                </Button>
                                <Button x:Name="UpButton" MinHeight="24" MinWidth="24" ToolTipService.ToolTip="{Binding Path=CollectionEditorControl_Up, Source={StaticResource ExtResources}}" IsEnabled="{TemplateBinding CanUserSortItems}">
                                    <Path Fill="{TemplateBinding Foreground}" Stretch="UniformToFill" Data="M3.5,12 L8.5,12 L8.5,6 L12,6 L6,-0 L0,6 L3.5,6 z" Width="10" Height="10" />
                                </Button>
                                <Button x:Name="DownButton" MinHeight="24" MinWidth="24" Margin="0,0,5,0" ToolTipService.ToolTip="{Binding Path=CollectionEditorControl_Down, Source={StaticResource ExtResources}}" IsEnabled="{TemplateBinding CanUserSortItems}">
                                    <Path Fill="{TemplateBinding Foreground}" Stretch="UniformToFill" Data="M3.5,0 L8.5,0 L8.5,6 L12,6 L6,12 L0,6 L3.5,6 z" Width="10" Height="10" />
                                </Button>
                                <Button x:Name="AddButton" MinHeight="24" Padding="10 0" Content="{Binding Path=CollectionEditorControl_Add, Source={StaticResource ExtResources}}" HorizontalAlignment="Right" IsEnabled="{TemplateBinding CanUserAddItems}" />
                            </StackPanel>
                        </Grid>
                        <TextBlock Text="{Binding Path=CollectionEditorControl_Properties, Source={StaticResource ExtResources}}" Grid.Column="2" />
                        <c1Ext:C1PropertyGrid x:Name="ItemsEditor" Grid.Column="2" Grid.Row="1" Margin="0,5" MinWidth="120" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" />
                        <StackPanel Orientation="Horizontal" Grid.Row="2" Margin="0 10 0 0" HorizontalAlignment="Right" Grid.ColumnSpan="3">
                            <Button x:Name="AcceptButton" Content="{Binding Path=CollectionEditorControl_OK, Source={StaticResource ExtResources}}" MinHeight="24" MinWidth="80" Margin="0 0 5 0" />
                            <Button x:Name="CancelButton" Content="{Binding Path=CollectionEditorControl_Cancel, Source={StaticResource ExtResources}}" MinHeight="24" MinWidth="80" />
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- AdvancedEditor @ C1PropertyGrid -->
    <Style TargetType="c1ExtPG:AdvancedEditor">
        <Setter Property="IsTabStop" Value="false" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1ExtPG:AdvancedEditor">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition MinWidth="70" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Grid Grid.Column="0" Grid.ColumnSpan="2">
                            <TextBox IsTabStop="False" Text="{TemplateBinding Label}" VerticalAlignment="Center" />
                            <!-- Forbid user to click it, but keep the editable style, to match the rest of the editors -->
                            <Canvas Background="Transparent" />
                        </Grid>
                        <Button x:Name="OpenButton" Content="..." Margin="5 1 1 1" Grid.Column="1" Width="25" BorderThickness="1 0 0 0" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--Button @ C1PropertyGrid to reset to default values -->
    <Style x:Key="PropertyGridResetButtonStyle" TargetType="Button">
        <Setter Property="Height" Value="8" />
        <Setter Property="Width" Value="8" />
        <Setter Property="Padding" Value="3" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DisabledElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <c1:C1BrushBuilder x:Name="BorderColorBrush" Input="{TemplateBinding Background}" DesignColor="{StaticResource BaseColor}" DesignBrush="{StaticResource PropGridResetButtonBorderBrush}" />
                        <Border x:Name="Background" Background="{TemplateBinding Background}" BorderBrush="{Binding Output, ElementName=BorderColorBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="{TemplateBinding BorderThickness}">
                        </Border>
                        <ContentPresenter x:Name="contentPresenter" />
                        <Border x:Name="FocusVisualElement" BorderBrush="{StaticResource SelectedBackground}" BorderThickness="{TemplateBinding BorderThickness}" Visibility="Collapsed" />
                        <Border x:Name="DisabledElement" Background="{StaticResource DisabledBrush}" Visibility="Collapsed" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- MethodBox @ C1PropertyGrid-->
    <Style TargetType="c1Ext:MethodBox">
        <Setter Property="Margin" Value="3" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1Ext:MethodBox">
                    <Button x:Name="ActionButton" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- PropertyBox @ C1PropertyGrid -->
    <Style TargetType="c1Ext:PropertyBox">
        <Setter Property="IsTabStop" Value="false" />
        <Setter Property="Padding" Value="3 2" />
        <Setter Property="MinHeight" Value="22" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1Ext:PropertyBox">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ExpansionStates">
                                <VisualState x:Name="ResetButtonHidden">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ResetButton" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ResetButtonShown">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ResetButton" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="Root" Background="{TemplateBinding Background}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <c1:C1BrushBuilder x:Name="LabelBackgroundBrush" Input="{TemplateBinding Background}" DesignColor="{StaticResource BaseColor}" DesignBrush="{StaticResource PropBoxLabelBrush}" />
                        <c1:C1BrushBuilder x:Name="EditorBackgroundBrush" Input="{TemplateBinding Background}" DesignColor="{StaticResource BaseColor}" DesignBrush="{StaticResource PropBoxEditorBrush}" />
                        <c1:C1BrushBuilder x:Name="BorderColorBrush" Input="{TemplateBinding Background}" DesignColor="{StaticResource BaseColor}" DesignBrush="{StaticResource PropBoxBorderBrush}" />
                        <Border Background="{Binding Output, ElementName=LabelBackgroundBrush}" BorderBrush="{Binding Output, ElementName=BorderColorBrush}" BorderThickness="0 0 1 0" />
                        <Border Grid.Column="1" Grid.ColumnSpan="2" Background="{Binding Output, ElementName=EditorBackgroundBrush}" />
                        <TextBlock x:Name="Label" VerticalAlignment="Center" Margin="{TemplateBinding Padding}" />
                        <Border x:Name="EditorBorder" VerticalAlignment="Center" Grid.Column="1" />
                        <Button x:Name="ResetButton" Grid.Column="2" ToolTipService.ToolTip="{Binding Path=PropertyGrid_Reset,Source={StaticResource ExtResources}}" Style="{StaticResource PropertyGridResetButtonStyle}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding Background}" Visibility="Collapsed" Margin="2" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--C1ExpanderButton @ C1PropertyGrid-->
    <Style x:Key="PropertyGridExpanderButton" TargetType="c1Ext:C1ExpanderButton">
        <Setter Property="Padding" Value="0" />
        <Setter Property="Height" Value="22" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1Ext:C1ExpanderButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="PressedElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="gridArrow" BeginTime="00:00:00" Duration="00:00:00.1000000" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" To="45" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="gridArrow" BeginTime="00:00:00" Duration="00:00:00.1000000" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" To="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Indeterminate">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="IndeterminateVisual" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused">
                                    <Storyboard />
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DirectionStates">
                                <VisualState x:Name="Left">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="btnArrow" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" To="90" Duration="0:0:0.0" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentTransformer" Storyboard.TargetProperty="LayoutTransform">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <RotateTransform Angle="90" />
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="btnArrow" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <system:Int32>1</system:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="btnArrow" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <system:Int32>0</system:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Right">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="btnArrow" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" To="-90" Duration="0:0:0.0" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentTransformer" Storyboard.TargetProperty="LayoutTransform">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <RotateTransform Angle="90" />
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="btnArrow" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <system:Int32>1</system:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="btnArrow" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <system:Int32>0</system:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Up">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="btnArrow" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" To="180" Duration="0:0:0.0" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="btnArrow" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <system:Int32>0</system:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="btnArrow" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <system:Int32>1</system:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Down">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="btnArrow" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" To="0" Duration="0:0:0.0" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="btnArrow" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <system:Int32>0</system:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="btnArrow" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <system:Int32>0</system:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <c1:C1BrushBuilder x:Name="BackgroundBrush" Input="{TemplateBinding Background}" DesignBrush="{StaticResource GeneralGradientBrush}" DesignColor="{StaticResource BaseColor}" />
                        <c1:C1BrushBuilder x:Name="MouseOverBrush" Input="{TemplateBinding MouseOverBrush}" DesignBrush="{StaticResource GeneralGradientOverBrush}" DesignColor="{StaticResource MouseOverColor}" />
                        <c1:C1BrushBuilder x:Name="PressedBrush" Input="{TemplateBinding PressedBrush}" DesignBrush="{StaticResource GeneralGradientSelectedBackground}" DesignColor="{StaticResource SelectedColor}" />
                        <c1:C1BrushBuilder x:Name="InnerBorderBrush" Input="{TemplateBinding Background}" DesignBrush="{StaticResource InnerBorderBrush}" DesignColor="{StaticResource BaseColor}" />
                        <c1:C1BrushBuilder x:Name="InnerBorderMouseOverBrush" Input="{TemplateBinding MouseOverBrush}" DesignBrush="{StaticResource InnerBorderMouseOverBrush}" DesignColor="{StaticResource MouseOverColor}" />
                        <c1:C1BrushBuilder x:Name="InnerBorderPressedBrush" Input="{TemplateBinding PressedBrush}" DesignBrush="{StaticResource InnerBorderPressedBrush}" DesignColor="{StaticResource SelectedColor}" />
                        <Border x:Name="BackgroundElement" Grid.RowSpan="2" Grid.ColumnSpan="2" Background="{Binding ElementName=BackgroundBrush, Path=Output}" BorderBrush="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" />
                        <Border x:Name="PressedElement" Grid.RowSpan="2" Grid.ColumnSpan="2" Background="{Binding ElementName=PressedBrush, Path=Output}" BorderBrush="{TemplateBinding PressedBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource PropGridExpanderCornerRadius}" Visibility="Collapsed" />
                        <Border x:Name="MouseOverElement" Grid.RowSpan="2" Grid.ColumnSpan="2" Background="{Binding ElementName=MouseOverBrush, Path=Output}" BorderBrush="{TemplateBinding MouseOverBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource PropGridExpanderCornerRadius}" Visibility="Collapsed" />
                        <Border x:Name="FocusVisualElement" Grid.RowSpan="2" Grid.ColumnSpan="2" BorderBrush="{TemplateBinding FocusBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource PropGridExpanderCornerRadius}" IsHitTestVisible="false" Opacity="0" />
                        <Grid x:Name="btnArrow" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Width="9" Height="9" Margin="3,0,0,0" RenderTransformOrigin="0.5,0.5">
                            <Grid.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform />
                                    <SkewTransform />
                                    <RotateTransform />
                                    <TranslateTransform />
                                </TransformGroup>
                            </Grid.RenderTransform>
                            <Grid x:Name="gridArrow" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Center" VerticalAlignment="Center">
                                <Grid.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform />
                                        <SkewTransform />
                                        <RotateTransform />
                                        <TranslateTransform />
                                    </TransformGroup>
                                </Grid.RenderTransform>
                                <Path HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" StrokeThickness="2" Data="M 0,0 L 3.5,3.5 L 0,7" Stroke="{TemplateBinding Foreground}" RenderTransformOrigin="0.5,0.5">
                                    <Path.RenderTransform>
                                        <RotateTransform x:Name="arrowRotation" Angle="0" CenterX="2.5" CenterY="4" />
                                    </Path.RenderTransform>
                                </Path>
                            </Grid>
                        </Grid>
                        <c1:C1LayoutTransformer Grid.Column="1" x:Name="contentTransformer" HorizontalAlignment="Left">
                            <ContentPresenter Margin="{TemplateBinding Padding}" VerticalAlignment="Center" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Cursor="{TemplateBinding Cursor}" />
                        </c1:C1LayoutTransformer>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ExpandDirection" Value="Down" />
    </Style>

    <!-- C1Expander @ C1PropertyGrid CategoryContainer-->
    <Style x:Key="PropertyGridCategoryContainerStyle" TargetType="c1Ext:C1Expander">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1Ext:C1Expander">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ExpansionStates">
                                <VisualState x:Name="Collapsed" />
                                <VisualState x:Name="Expanded">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DirectionStates">
                                <VisualState x:Name="Left" />
                                <VisualState x:Name="Right" />
                                <VisualState x:Name="Up" />
                                <VisualState x:Name="Down">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandButton" Storyboard.TargetProperty="(Grid.Row)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <system:Int32>0</system:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandButton" Storyboard.TargetProperty="(Grid.Column)">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <system:Int32>1</system:Int32>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        
                        
                        <Border Background="{StaticResource WpfInputBaseBrush}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="*" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <c1Ext:C1ExpanderButton x:Name="ExpandButton" Background="{TemplateBinding HeaderBackground}" MouseOverBrush="{TemplateBinding MouseOverBrush}" PressedBrush="{TemplateBinding ExpandedBackground}" FocusBrush="{TemplateBinding FocusBrush}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0 1" Padding="{TemplateBinding HeaderPadding}" FontSize="{TemplateBinding HeaderFontSize}" FontStretch="{TemplateBinding HeaderFontStretch}" FontStyle="{TemplateBinding HeaderFontStyle}" FontWeight="{TemplateBinding HeaderFontWeight}" Foreground="{TemplateBinding HeaderForeground}" FontFamily="{TemplateBinding HeaderFontFamily}" HorizontalContentAlignment="{TemplateBinding HorizontalHeaderAlignment}" VerticalContentAlignment="{TemplateBinding VerticalHeaderAlignment}" IsTabStop="False" ExpandDirection="{TemplateBinding ExpandDirection}" Content="{TemplateBinding Header}" IsEnabled="{TemplateBinding IsExpandable}" ContentTemplate="{TemplateBinding HeaderTemplate}" Style="{StaticResource PropertyGridExpanderButton}" />
                                <Border Grid.Column="1" Grid.Row="1">
                                    <ContentPresenter x:Name="Content" Margin="12 0 0 0" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Cursor="{TemplateBinding Cursor}" Visibility="Collapsed" />
                                </Border>
                            </Grid>
                        </Border>
                        <Border x:Name="DisabledVisualElement" Background="{StaticResource DisabledBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource PropGridCornerRadius}" IsHitTestVisible="False" Opacity="0" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c1Ext:C1PropertyGrid">
        
        
        <Setter Property="BorderBrush" Value="{StaticResource WpfInputBorderBrush}" />
        <Setter Property="MouseOverBrush" Value="{StaticResource WpfInputMouseOverBrush}" />
        <Setter Property="PressedBrush" Value="{StaticResource WpfInputSelectedBackground}" />        
        <Setter Property="CategoryBackground" Value="{StaticResource WpfInputBaseBrush}" />
        <Setter Property="Background" Value="{StaticResource PropGridBackground}" />
        <Setter Property="Foreground" Value="{StaticResource ForegroundTextBoxBrushColor}" />
        <Setter Property="BorderThickness" Value="{StaticResource PropGridThickness}" />
        <Setter Property="CategoryForeground" Value="{StaticResource ForegroundTextBoxBrushColor}" />
        <Setter Property="CategoryContainerStyle" Value="{StaticResource PropertyGridCategoryContainerStyle}" />
        <Setter Property="ScrollBarStyle" Value="{StaticResource ScrollBarClearStyle}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1Ext:C1PropertyGrid">
                    <Grid>
                        <c1:C1BrushBuilder x:Name="DescriptionBrush" Input="{TemplateBinding Background}" DesignBrush="{StaticResource PropGridDescriptionBrush}" DesignColor="{StaticResource BaseColor}" />
                        <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{StaticResource PropGridCornerRadius}" Background="{TemplateBinding Background}">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="Normal" />
                                        <VisualState x:Name="Disabled">
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.0" />
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="MouseOver" />
                                    </VisualStateGroup>
                                    <VisualStateGroup x:Name="FocusStates">
                                        <VisualState x:Name="Focused" />
                                        <VisualState x:Name="Unfocused" />
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Padding="0" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Style="{StaticResource ScrollViewerClearStyle}" c1:ClearStyleExtensions.ScrollBarStyle="{TemplateBinding ScrollBarStyle}">
                                    <StackPanel>
                                        <ItemsControl x:Name="Properties" IsTabStop="False" Margin="0" Padding="0" />
                                        <ItemsControl x:Name="Methods" IsTabStop="False" Margin="0" Padding="0" />
                                    </StackPanel>
                                    <c1:ScrollViewerTouchBehavior.TouchBehavior>
                                        <c1:ScrollViewerTouchBehavior />
                                    </c1:ScrollViewerTouchBehavior.TouchBehavior>
                                </ScrollViewer>
                                <Border x:Name="DescriptionArea" Grid.Row="1" Margin="2 10 2 2" BorderThickness="1" Background="{Binding ElementName=DescriptionBrush, Path=Output}" BorderBrush="{TemplateBinding BorderBrush}">
                                    <TextBlock x:Name="Description" Margin="2" MinHeight="60" TextWrapping="Wrap" Foreground="{TemplateBinding Foreground}" />
                                </Border>
                            </Grid>
                        </Border>
                        <Border x:Name="DisabledVisualElement" Background="{StaticResource DisabledBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource PropGridCornerRadius}" IsHitTestVisible="False" Visibility="{TemplateBinding DisabledCuesVisibility}" Opacity="0" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
