<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:c1="using:C1.Xaml"
    xmlns:c1Ext="using:C1.Xaml.Extended"
    xmlns:c1Ext_Resources="using:C1.Silverlight.Resources" >
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="ms-appx:///C1.UWP/themes/C1Button.xaml" />
        <ResourceDictionary Source="ms-appx:///C1.UWP/themes/Common.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!--******************** C1ColorPicker ******************-->

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

    <c1:ColorConverter x:Key="colorConverter"/>

    <!-- Brush @ Separator Element -->
    <SolidColorBrush x:Key="ButtonSeparator2ndBrush" Color="#FFFAFBFC"/>

    <!-- Brush @ C1ColorPicker Section HeaderedContentControl Background -->
    <SolidColorBrush x:Key="ColorPickerSectionBackground" Color="#FFF0F4F7"/>

    <!-- C1CheckeredBorder -->
    <Style TargetType="c1Ext:C1CheckeredBorder">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1Ext:C1CheckeredBorder">
                    <Grid>
                        <Canvas x:Name="Background" Margin="{TemplateBinding BorderThickness}"/>
                        <Border Background="{TemplateBinding Background}" 
                                BorderBrush="{TemplateBinding BorderBrush}" 
                                BorderThickness="{TemplateBinding BorderThickness}" 
                                CornerRadius="{TemplateBinding CornerRadius}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Thumb @ C1SpectrumColorPicker Slider -->
    <Style x:Key="ColorPickerThumbStyle" TargetType="Thumb">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Thumb">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="PointerOverElement" 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="PointerOverElement" 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="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="ThumbBackground" 
                                Background="{TemplateBinding Background}" 
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="1"
                                CornerRadius="1"/>
                        <Border x:Name="PointerOverElement" 
                                BorderBrush="{StaticResource MouseOverBrush}"
                                BorderThickness="1"
                                CornerRadius="2"
                                Margin="-1"
                                Visibility="Collapsed"/>
                        <Border x:Name="DisabledVisualElement" 
                                Background="{StaticResource DisabledBrush}" 
                                CornerRadius="1"
                                Visibility="Collapsed"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Slider @ C1SpectrumColorPicker -->
    <Style TargetType="c1Ext:C1ColorSlider">
        <Setter Property="Background" Value="{x:Null}"/>
        <Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Orientation" Value="Vertical"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1Ext:C1ColorSlider">
                    <Grid x:Name="Root">
                        <Grid.Resources>
                            <ControlTemplate x:Key="RepeatButtonTemplate">
                                <Grid x:Name="Root" Background="Transparent" Opacity="0"/>
                            </ControlTemplate>
                        </Grid.Resources>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.5"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused"/>
                                <VisualState x:Name="Focused">
                                    <Storyboard/>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="VerticalTemplate" >
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <c1Ext:C1CheckeredBorder Width="30" SquareWidth="8" Grid.RowSpan="3"
                                    Background="{TemplateBinding Background}" 
                                    BorderBrush="{TemplateBinding BorderBrush}" 
                                    BorderThickness="1"/>
                            <RepeatButton x:Name="VerticalTrackLargeChangeDecreaseRepeatButton" Grid.Row="2" IsTabStop="False" 
                                        Template="{StaticResource RepeatButtonTemplate}"/>
                            <Rectangle x:Name="VerticalDecreaseRect" Fill="Transparent" Grid.RowSpan="3"/>
                            <Rectangle x:Name="BottomTrack" Grid.Row="2" Fill="#00FFFFFF" />
                            <Thumb x:Name="VerticalThumb" Width="30" Height="30" Grid.Row="1"
                                    Background="{TemplateBinding Background}" 
                                    BorderBrush="{TemplateBinding BorderBrush}" 
                                    Style="{StaticResource ColorPickerThumbStyle}" 
                                    DataContext="{TemplateBinding Value}"/>
                            <RepeatButton x:Name="VerticalTrackLargeChangeIncreaseRepeatButton" IsTabStop="False" 
                                    Template="{StaticResource RepeatButtonTemplate}"/>
                            <Rectangle x:Name="TopTrack" Fill="#00FFFFFF"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- C1SpectrumPad -->
    <Style TargetType="c1Ext:C1SpectrumPad">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
        <Setter Property="IsTabStop" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1Ext:C1SpectrumPad">
                    <Grid BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Rectangle Fill="{Binding Value, Converter={StaticResource colorConverter}, ElementName=Hue}" />
                        <Rectangle>
                            <Rectangle.Fill>
                                <LinearGradientBrush  StartPoint="0,0" EndPoint="1,0">
                                    <GradientStop Color="White" Offset="0"/>
                                    <GradientStop Offset="1"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Rectangle>
                            <Rectangle.Fill>
                                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                    <GradientStop Offset="0"/>
                                    <GradientStop Color="Black" Offset="1"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <!-- saturation & luminance -->
                        <Canvas x:Name="PadCanvas">
                            <Canvas x:Name="Indicator">
                                <Ellipse Height="7" Width="7" Fill="Transparent" Stroke="#FFFFFFFF" StrokeThickness="1" Margin="-3.5 -3.5 0 0" />
                                <Ellipse Height="9" Width="9" Fill="Transparent" Stroke="#FF737373" Margin="-4.5 -4.5 0 0" />
                            </Canvas>
                        </Canvas>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- C1SpectrumColorPicker -->
    <Style TargetType="c1Ext:C1SpectrumColorPicker">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1Ext:C1SpectrumColorPicker">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <c1Ext:C1SpectrumPad x:Name="Pad" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
                        <c1Ext:C1ColorSlider x:Name="Hue"
                                            Grid.Column="1"
                                            Minimum="0"
                                            Maximum="1"
                                            Margin="4 0 0 0"
                                            SmallChange="0.1"
                                            LargeChange="0.2"
                                            StepFrequency="0.1"
                                            Orientation="Vertical"
                                            BorderBrush="{TemplateBinding BorderBrush}"
                                            BorderThickness="{TemplateBinding BorderThickness}">
                            <c1Ext:C1ColorSlider.Background>
                                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                    <GradientStop Color="#FFFF0000" Offset="0"/>
                                    <GradientStop Color="#FEFFFF00" Offset="0.17"/>
                                    <GradientStop Color="#FE00FF00" Offset="0.317"/>
                                    <GradientStop Color="#FE00FFFF" Offset="0.464"/>
                                    <GradientStop Color="#FE0000FF" Offset="0.625"/>
                                    <GradientStop Color="#FEFF00FF" Offset="0.857"/>
                                    <GradientStop Color="#FFFF0000" Offset="1"/>
                                </LinearGradientBrush>
                            </c1Ext:C1ColorSlider.Background>
                        </c1Ext:C1ColorSlider>
                        <c1Ext:C1ColorSlider x:Name="Alpha"
                                            Grid.Column="2"
                                            Minimum="0"
                                            Maximum="1"
                                            Margin="4 0 0 0"
                                            SmallChange="0.1"
                                            LargeChange="0.2"
                                            StepFrequency="0.1"
                                            Orientation="Vertical"
                                            BorderBrush="{TemplateBinding BorderBrush}"
                                            BorderThickness="{TemplateBinding BorderThickness}"
                                            Visibility="{Binding ShowAlphaChannel, Converter={StaticResource visibilityConverter}, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
                            <c1Ext:C1ColorSlider.Background>
                                <LinearGradientBrush x:Name="alphaBrush" StartPoint="0,0" EndPoint="0,1">
                                    <GradientStop Color="Black" Offset="0"/>
                                    <GradientStop Color="Transparent" Offset="1"/>
                                </LinearGradientBrush>
                            </c1Ext:C1ColorSlider.Background>
                        </c1Ext:C1ColorSlider>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- ItemsControl @ C1ColorPicker (Palette, Standard & Recent Colors} -->
    <Style x:Key="ColorPickerItemsControl" TargetType="ItemsControl">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Vertical" />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ItemsControl">
                    <ItemsPresenter VerticalAlignment="Center" HorizontalAlignment="Center" Margin="2 0"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- C1HeaderedContentControl @ C1ColorPicker Section -->
    <Style x:Key="ColorPickerSection" TargetType="c1:C1HeaderedContentControl">
        <Setter Property="Padding" Value="0 3 0 4"/>
        <Setter Property="HeaderPadding" Value="3 2"/>
        <Setter Property="HeaderTemplate">
            <Setter.Value>
                <DataTemplate>
                    <TextBlock Text="{Binding}"/>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1:C1HeaderedContentControl">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Disabled"/>
                                <VisualState x:Name="MouseOver" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <c1:C1BrushBuilder x:Name="BackgroundBrush" Input="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}" DesignBrush="{StaticResource ColorPickerSectionBackground}" DesignColor="{StaticResource BaseColor}"/>
                        <ContentControl Content="{TemplateBinding Header}"
                                            Background="{TemplateBinding Background}" 
                                            BorderBrush="{TemplateBinding BorderBrush}" 
                                            BorderThickness="0 0 0 1"                                
                                            Margin="1"
                                            Padding="{TemplateBinding HeaderPadding}"
                                            ContentTemplate="{TemplateBinding HeaderTemplate}"
                                            FontFamily="{TemplateBinding HeaderFontFamily}"
                                            FontStretch="{TemplateBinding HeaderFontStretch}"
                                            FontStyle="{TemplateBinding HeaderFontStyle}" 
                                            FontWeight="{TemplateBinding HeaderFontWeight}"
                                            Foreground="{TemplateBinding HeaderForeground}"
                                            HorizontalContentAlignment="{TemplateBinding HorizontalHeaderAlignment}"
                                            VerticalContentAlignment="{TemplateBinding VerticalHeaderAlignment}"/>
                        <ContentPresenter x:Name="Content" Margin="{TemplateBinding Padding}"
                                          Background="{Binding Output, ElementName=BackgroundBrush}" Grid.Row="1"
                                          Content="{TemplateBinding Content}"
                                          ContentTemplate="{TemplateBinding ContentTemplate}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- ColorButton @ C1ColorPicker -->
    <Style TargetType="c1Ext:C1ColorButton">
        <Setter Property="Height" Value="40"/>
        <Setter Property="Width" Value="40"/>
        <Setter Property="IsEnabled" Value="true"/>
        <Setter Property="IsTabStop" Value="true"/>
        <Setter Property="MinWidth" Value="5"/>
        <Setter Property="MinHeight" Value="5"/>
        <Setter Property="Margin" Value="0 0 0 -1"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1Ext:C1ColorButton">
                    <Grid>
                        <Grid.Resources>
                            <c1:ColorConverter x:Key="colorConverter"/>
                        </Grid.Resources>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.1" To="Selected"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Pressed"/>
                                <VisualState x:Name="Disabled"/>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="rectangle1" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <c1Ext:C1CheckeredBorder SquareWidth="8" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Background="{Binding Color, Converter={StaticResource colorConverter}, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
                        <Rectangle x:Name="rectangle" Stroke="OrangeRed" StrokeThickness="1" RadiusX="1" Opacity="0"/>
                        <Rectangle x:Name="rectangle1" Stroke="Yellow" StrokeThickness="1" Margin="1" Opacity="0"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--ToggleButton @ C1ColorPicker -->

    <!-- Size @ C1Button -->
    <Style x:Key="C1ButtonStyle" TargetType="Grid">
        <Setter Property="Width" Value="15"/>
    </Style>

    <!-- Thickness @ C1Button -->
    <Thickness x:Key="C1ButtonBorderThickness">1 0 0 0</Thickness>
    <!-- Thickness @ C1Button -->
    <CornerRadius x:Key="C1ButtonCornerRadius">0 1 1 0</CornerRadius>
    <!-- Thickness @ C1Button Inner Element -->
    <CornerRadius x:Key="C1ButtonInnerCornerRadius">0 0 0 0</CornerRadius>

    <!-- C1ColorPicker -->
    <Style TargetType="c1Ext:C1ColorPicker">
        <Setter Property="Background" Value="{StaticResource BaseColorBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
        <Setter Property="MouseOverBrush" Value="{StaticResource MouseOverBrush}"/>
        <Setter Property="PressedBrush" Value="{StaticResource SelectedBackground}"/>
        <Setter Property="FocusBrush" Value="{StaticResource FocusBrush}"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Padding" Value="4 4 0 4"/>
        <Setter Property="ColorContainerStyle" Value="{StaticResource ColorPickerItemsControl}" />
        <Setter Property="Foreground" Value="{StaticResource ForegroundBrushColor}"/>
        <Setter Property="BorderThickness" Value="{StaticResource GeneralThickness}"/>
        <Setter Property="InputBackground" Value="{StaticResource InputBackgroundBrush}"/>
        <Setter Property="InputForeground" Value="{StaticResource ForegroundTextBoxBrushColor}"/>
        <Setter Property="CornerRadius" Value="{StaticResource GeneralCornerRadius}"/>
        <Setter Property="IsDropDownOpen" Value="False"/>
        <Setter Property="Mode" Value="Both"/>
        <Setter Property="Width" Value="200" />
        <Setter Property="Height" Value="50" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1Ext:C1ColorPicker">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                </VisualState>
                                <VisualState x:Name="MouseOver" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="Focused"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid"/>
                                <VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationDecorator" Storyboard.TargetProperty="ValidationState">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <c1:ValidationState>InvalidUnfocused</c1:ValidationState>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationDecorator" Storyboard.TargetProperty="ValidationState">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <c1:ValidationState>InvalidFocused</c1:ValidationState>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <c1:C1DropDownButton x:Name="DropDown"
                                             AutoClose="True"
                                             MinWidth="{TemplateBinding MinWidth}"
                                             MinHeight="{TemplateBinding MinHeight}"
                                             Width="{TemplateBinding Width}"
                                             Height="{TemplateBinding Height}"
                                             DropDownDirection="{TemplateBinding DropDownDirection}"
                                             Background="{TemplateBinding Background}"
                                             HeaderBackground="{TemplateBinding Background}"
                                             Foreground="{TemplateBinding Foreground}"
                                             BorderBrush="{TemplateBinding BorderBrush}"
                                             BorderThickness="{TemplateBinding BorderThickness}"
                                             IsEnabled="{TemplateBinding IsEnabled}"
                                             MouseOverBrush="{TemplateBinding MouseOverBrush}"
                                             PressedBrush="{TemplateBinding PressedBrush}"
                                             FocusBrush="{TemplateBinding FocusBrush}"
                                             HeaderPadding="{TemplateBinding Padding}"
                                             CornerRadius="{TemplateBinding CornerRadius}">
                            <c1:C1DropDownButton.Header>
                                <Grid MinHeight="8" MinWidth="8">
                                    <c1Ext:C1CheckeredBorder SquareWidth="5" Margin="1" />
                                    <Border Background="{TemplateBinding SelectedBrush}" 
                                                BorderBrush="{TemplateBinding BorderBrush}" 
                                                BorderThickness="1" />
                                </Grid>
                            </c1:C1DropDownButton.Header>
                            <c1:C1TabControl x:Name="Tabs" TabStripPlacement="Bottom"
                                    Background="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}"
                                    BorderBrush="{Binding BorderBrush, RelativeSource={RelativeSource TemplatedParent}}"
                                                    BorderThickness="1"
                                                    CanUserReorder="False"
                                                    MouseOverBrush="{Binding MouseOverBrush, RelativeSource={RelativeSource TemplatedParent}}"
                                                    PressedBrush="{Binding PressedBrush, RelativeSource={RelativeSource TemplatedParent}}"
                                                    TabStripBackground="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}"
                                                    TabStripForeground="{Binding Foreground, RelativeSource={RelativeSource TemplatedParent}}"
                                                     SelectedBackground="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}"
                                                    Padding="0" >
                                <c1:C1TabItem x:Name="BasicTab">
                                    <c1:C1TabItem.HeaderTemplate>
                                        <DataTemplate>
                                            <Grid>
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="17"/>
                                                    <ColumnDefinition/>
                                                </Grid.ColumnDefinitions>
                                                <Border Width="13" Height="13" Background="#FF97AEBF">
                                                    <Grid>
                                                        <Rectangle Height="10" HorizontalAlignment="Left" VerticalAlignment="Top" Width="3" Fill="#FFFF0000" Margin="1 1 0 0"/>
                                                        <Rectangle Height="5" HorizontalAlignment="Left" VerticalAlignment="Top" Width="3" Fill="#FFFFC000" Margin="5 1 0 0"/>
                                                        <Rectangle Height="5" HorizontalAlignment="Left" VerticalAlignment="Top" Width="3" Fill="#FFFFFF00" Margin="9 1 0 0"/>
                                                        <Rectangle Height="5" HorizontalAlignment="Left" VerticalAlignment="Top" Width="3" Fill="#FF92D050" Margin="1 5 0 0"/>
                                                        <Rectangle Height="5" HorizontalAlignment="Left" VerticalAlignment="Top" Width="3" Fill="#FF00B050" Margin="5 5 0 0"/>
                                                        <Rectangle Height="5" HorizontalAlignment="Left" VerticalAlignment="Top" Width="3" Fill="#FF0C8242" Margin="9 5 0 0"/>
                                                        <Rectangle Height="5" HorizontalAlignment="Left" VerticalAlignment="Top" Width="3" Fill="#FF0070C0" Margin="1 9 0 0"/>
                                                        <Rectangle Height="5" HorizontalAlignment="Left" VerticalAlignment="Top" Width="3" Fill="#FF002060" Margin="5 9 0 0"/>
                                                        <Rectangle Height="5" HorizontalAlignment="Left" VerticalAlignment="Top" Width="3" Fill="#FF7030A0" Margin="9 9 0 0"/>
                                                    </Grid>
                                                </Border>
                                                <TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Text="{Binding ColorPicker_Basic, Source={StaticResource ExtResources}}" TextWrapping="Wrap" Grid.Column="1"/>
                                            </Grid>
                                        </DataTemplate>
                                    </c1:C1TabItem.HeaderTemplate>
                                    <c1Ext:C1BasicColorPickerPart x:Name="Basic" 
                                                            Background="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}" 
                                                            Foreground="{Binding Foreground, RelativeSource={RelativeSource TemplatedParent}}"
                                                            BorderBrush="{Binding BorderBrush, RelativeSource={RelativeSource TemplatedParent}}"/>
                                </c1:C1TabItem>
                                <c1:C1TabItem x:Name="AdvancedTab">
                                    <c1:C1TabItem.HeaderTemplate>
                                        <DataTemplate>
                                            <Grid>
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="17"/>
                                                    <ColumnDefinition/>
                                                </Grid.ColumnDefinitions>
                                                <TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Text="{Binding ColorPicker_Advanced, Source={StaticResource ExtResources}}" TextWrapping="Wrap" Grid.Column="1"/>
                                                <Ellipse Height="14" Margin="0.5,-1,3,-1" Fill="#FFFFFFFF" Width="14"/>
                                                <Ellipse Width="14" Height="14" Margin="0.5,-1,3,-1">
                                                    <Ellipse.Fill>
                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                            <GradientStop Color="#FFFF0000" Offset="0.1"/>
                                                            <GradientStop Color="#00FF0000" Offset="0.5"/>
                                                        </LinearGradientBrush>
                                                    </Ellipse.Fill>
                                                </Ellipse>
                                                <Ellipse Height="14" HorizontalAlignment="Stretch" Margin="0.5,-1,3,-1" VerticalAlignment="Stretch" Width="14">
                                                    <Ellipse.Fill>
                                                        <LinearGradientBrush EndPoint="0.982999980449677,0.179000005125999" StartPoint="0.0879999995231628,0.753000020980835">
                                                            <GradientStop Color="#FF079BF0"  Offset="0.1"/>
                                                            <GradientStop Color="#00079BF0" Offset="0.5"/>
                                                        </LinearGradientBrush>
                                                    </Ellipse.Fill>
                                                </Ellipse>
                                                <Ellipse Height="14" HorizontalAlignment="Stretch" Margin="0.5,-1,3,-1" VerticalAlignment="Stretch" Width="14">
                                                    <Ellipse.Fill>
                                                        <LinearGradientBrush EndPoint="0.136000007390976,0.174999997019768" StartPoint="0.843999981880188,0.822000026702881">
                                                            <GradientStop Color="#FFF2F413"  Offset="0.1"/>
                                                            <GradientStop Color="#00F2F413" Offset="0.5"/>
                                                        </LinearGradientBrush>
                                                    </Ellipse.Fill>
                                                </Ellipse>
                                                <Ellipse Height="14" HorizontalAlignment="Stretch" Margin="0.5,-1,3,-1" VerticalAlignment="Stretch" Width="14" Visibility="Visible">
                                                    <Ellipse.Fill>
                                                        <LinearGradientBrush>
                                                            <GradientStop Color="#00000000" Offset="0.772"/>
                                                            <GradientStop Color="#4C000000" Offset="1"/>
                                                        </LinearGradientBrush>
                                                    </Ellipse.Fill>
                                                </Ellipse>
                                                <Ellipse Height="15" HorizontalAlignment="Stretch" Margin="-0.5,-1.5,2.5,-1.5" VerticalAlignment="Stretch" Width="15" Stroke="#FF8AA3B5"/>
                                            </Grid>
                                        </DataTemplate>
                                    </c1:C1TabItem.HeaderTemplate>
                                    <c1Ext:C1AdvancedColorPickerPart x:Name="Advanced" 
                                                                         Background="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}" 
                                                                         Foreground="{Binding Foreground, RelativeSource={RelativeSource TemplatedParent}}"
                                                                         InputBackground="{Binding InputBackground, RelativeSource={RelativeSource TemplatedParent}}" 
                                                                         InputForeground="{Binding InputForeground, RelativeSource={RelativeSource TemplatedParent}}"
                                                                         BorderBrush="{Binding BorderBrush, RelativeSource={RelativeSource TemplatedParent}}"
                                                                         MouseOverBrush="{Binding MouseOverBrush, RelativeSource={RelativeSource TemplatedParent}}"
                                                                         PressedBrush="{Binding PressedBrush, RelativeSource={RelativeSource TemplatedParent}}"
                                                                         FocusBrush="{Binding FocusBrush, RelativeSource={RelativeSource TemplatedParent}}"/>
                                </c1:C1TabItem>
                            </c1:C1TabControl>
                        </c1:C1DropDownButton>
                        <c1:C1ValidationDecorator x:Name="ValidationDecorator" 
                                                  Target="{Binding RelativeSource={RelativeSource TemplatedParent}}" 
                                                  Style="{TemplateBinding ValidationDecoratorStyle}" 
                                                  CornerRadius="{TemplateBinding CornerRadius}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c1Ext:C1BasicColorPickerPart">
        <Setter Property="Background" Value="{StaticResource BaseColorBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource ForegroundTextBoxBrushColor}"/>
        <Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
        <Setter Property="BorderThickness" Value="{StaticResource GeneralThickness}"/>
        <Setter Property="ColorContainerStyle" Value="{StaticResource ColorPickerItemsControl}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1Ext:C1BasicColorPickerPart">
                    <StackPanel>
                        <!-- Theme Colors -->
                        <c1:C1HeaderedContentControl Header="{Binding ColorPicker_PaletteColors, Source={StaticResource ExtResources}}" 
                                                     HeaderForeground="{TemplateBinding Foreground}" 
                                                     HeaderFontFamily="{TemplateBinding FontFamily}" 
                                                     HeaderFontStretch="{TemplateBinding FontStretch}"
                                                     HeaderFontStyle="{TemplateBinding FontStyle}"
                                                     HeaderFontWeight="{TemplateBinding FontWeight}"
                                                     Background="{TemplateBinding Background}"
                                                     BorderBrush="{TemplateBinding BorderBrush}"
                                                     Style="{StaticResource ColorPickerSection}">
                            <Grid HorizontalAlignment="Center">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="2" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="2"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="2"/>
                                </Grid.ColumnDefinitions>
                                <!-- Headers -->
                                <Grid x:Name="ThemeColorsHeader" Grid.Column="1"/>
                                <!-- Values -->
                                <Grid x:Name="ThemeColorsValues" Grid.Column="1" Grid.Row="2"/>
                            </Grid>
                        </c1:C1HeaderedContentControl>
                        <!-- Standard Colors -->
                        <c1:C1HeaderedContentControl Header="{Binding ColorPicker_StandardColors, Source={StaticResource ExtResources}}"
                                                        HeaderForeground="{TemplateBinding Foreground}" 
                                                        HeaderFontFamily="{TemplateBinding FontFamily}" 
                                                     HeaderFontStretch="{TemplateBinding FontStretch}"
                                                     HeaderFontStyle="{TemplateBinding FontStyle}"
                                                     HeaderFontWeight="{TemplateBinding FontWeight}"
                                                        Background="{TemplateBinding Background}"
                                                        BorderBrush="{TemplateBinding BorderBrush}"
                                                        Style="{StaticResource ColorPickerSection}">
                            <Grid HorizontalAlignment="Center">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="2"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="2"/>
                                </Grid.ColumnDefinitions>
                                <Grid x:Name="StandardColors" Grid.Column="1"/>
                            </Grid>
                        </c1:C1HeaderedContentControl>
                        <!-- Recent Colors -->
                        <c1:C1HeaderedContentControl x:Name="RecentColorsHeader" Header="{Binding ColorPicker_RecentColors, Source={StaticResource ExtResources}}"
                                                     HeaderForeground="{TemplateBinding Foreground}" 
                                                     HeaderFontFamily="{TemplateBinding FontFamily}" 
                                                     HeaderFontStretch="{TemplateBinding FontStretch}"
                                                     HeaderFontStyle="{TemplateBinding FontStyle}"
                                                     HeaderFontWeight="{TemplateBinding FontWeight}"
                                                     Background="{TemplateBinding Background}"
                                                     BorderBrush="{TemplateBinding BorderBrush}"
                                                     Style="{StaticResource ColorPickerSection}"
                                                     Visibility="{Binding ShowRecentColors, Converter={StaticResource visibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="2"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="2"/>
                                </Grid.ColumnDefinitions>
                                <Grid x:Name="RecentColors" Grid.Column="1"/>
                            </Grid>
                        </c1:C1HeaderedContentControl>
                        <!-- Transparent Color -->
                        <c1:C1HeaderedContentControl Header="{Binding ColorPicker_TransparentColor, Source={StaticResource ExtResources}}"
                                                     HeaderForeground="{TemplateBinding Foreground}" 
                                                     HeaderFontFamily="{TemplateBinding FontFamily}" 
                                                     HeaderFontStretch="{TemplateBinding FontStretch}"
                                                     HeaderFontStyle="{TemplateBinding FontStyle}"
                                                     HeaderFontWeight="{TemplateBinding FontWeight}"
                                                     Background="{TemplateBinding Background}"
                                                     BorderBrush="{TemplateBinding BorderBrush}"
                                                     Style="{StaticResource ColorPickerSection}"
                                                     Visibility="{Binding ShowTransparentColor, Converter={StaticResource visibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Grid x:Name="TransparentColor" Margin="2 0"/>
                                <TextBlock Text="{Binding ColorPicker_TransparentColor, Source={StaticResource ExtResources}}" Grid.Column="1" 
                                                            Foreground="{TemplateBinding Foreground}" TextAlignment="Left"/>
                            </Grid>
                        </c1:C1HeaderedContentControl>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c1Ext:C1AdvancedColorPickerPart">
        <Setter Property="Background" Value="{StaticResource BaseColorBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource ForegroundTextBoxBrushColor}"/>
        <Setter Property="InputBackground" Value="{StaticResource InputBackgroundBrush}"/>
        <Setter Property="InputForeground" Value="{StaticResource ForegroundTextBoxBrushColor}"/>
        <Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
        <Setter Property="BorderThickness" Value="{StaticResource GeneralThickness}"/>
        <Setter Property="MouseOverBrush" Value="{StaticResource MouseOverBrush}"/>
        <Setter Property="PressedBrush" Value="{StaticResource SelectedBackground}"/>
        <Setter Property="FocusBrush" Value="{StaticResource SelectedBackground}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1Ext:C1AdvancedColorPickerPart">
                    <StackPanel>
                        <!-- Theme Colors -->
                        <c1:C1HeaderedContentControl Header="{Binding ColorPicker_CustomColors, Source={StaticResource ExtResources}}"
                                                            HeaderForeground="{TemplateBinding Foreground}" 
                                                            HeaderFontFamily="{TemplateBinding FontFamily}" 
                                                     HeaderFontStretch="{TemplateBinding FontStretch}"
                                                     HeaderFontStyle="{TemplateBinding FontStyle}"
                                                     HeaderFontWeight="{TemplateBinding FontWeight}"
                                                            Background="{TemplateBinding Background}"
                                                            BorderBrush="{TemplateBinding BorderBrush}"
                                                            Style="{StaticResource ColorPickerSection}">
                            <Grid Margin="4 0">
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid Width="436">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="6*"/>
                                        <ColumnDefinition Width="4*" />
                                    </Grid.ColumnDefinitions>
                                    <!-- Visual selection -->
                                    <c1Ext:C1SpectrumColorPicker x:Name="Spectrum" Height="335" Margin="0 0 0 4"
                                                                    ShowAlphaChannel="{TemplateBinding ShowAlphaChannel}"
                                                                    BorderBrush="{TemplateBinding BorderBrush}"/>
                                    <!-- Preview -->
                                    <c1Ext:C1CheckeredBorder x:Name="Preview"  Grid.Column="1" SquareWidth="8" Margin="5 0 0 4"
                                                                BorderBrush="{TemplateBinding BorderBrush}" 
                                                                BorderThickness="1"/>
                                </Grid>
                                <Grid Grid.Row="1">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition />
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Text="#" Margin="1 10" Grid.Column="1" Foreground="{TemplateBinding Foreground}"/>
                                    <c1:C1TextBoxBase Opacity="0" VerticalContentAlignment="Center" IsHitTestVisible="False" IsTabStop="False" Text="MMMMMMMM" IsEnabled="False" />
                                    <c1Ext:C1HexColorBox x:Name="InputWeb"
                                                         Padding="8"
                                                         Margin="10 2"
                                                         Grid.Column="1"
                                                         Width="90"
                                                         HorizontalAlignment="Center"
                                                         Color="{Binding Color, ElementName=Spectrum, Mode=TwoWay}" 
                                                         ShowAlphaChannel="{TemplateBinding ShowAlphaChannel}" 
                                                         Background="{TemplateBinding InputBackground}" 
                                                         Foreground="{TemplateBinding InputForeground}"
                                                         BorderBrush="{TemplateBinding BorderBrush}" 
                                                         BorderThickness="{StaticResource GeneralThickness}"
                                                         MouseOverBrush ="{TemplateBinding MouseOverBrush}"
                                                         FocusBrush="{TemplateBinding FocusBrush}"
                                                         />
                                    <!-- Ok button -->
                                    <Button x:Name="OkButton" 
                                            Grid.Column="2"
                                            Padding="8"
                                            Width="60"
                                            HorizontalAlignment="Right"
                                            VerticalContentAlignment="Center"
                                            Content="{Binding ColorPicker_OK, Source={StaticResource ExtResources}}" 
                                            Background="{TemplateBinding Background}" 
                                            Foreground="{TemplateBinding Foreground}" 
                                            BorderBrush="{TemplateBinding BorderBrush}" 
                                            BorderThickness="{StaticResource GeneralThickness}"
                                            c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}"
                                            c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}"
                                            c1:ClearStyleExtensions.FocusBrush="{TemplateBinding FocusBrush}"
                                            c1:ClearStyleExtensions.CornerRadius="{StaticResource GeneralCornerRadius}"
                                            Style="{StaticResource ClearStyleButtonStyle}"
                                            />
                                </Grid>
                            </Grid>
                        </c1:C1HeaderedContentControl>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
