	  
	   
    
		

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

	<!--******************** ClearStyle Button *********************-->
	<!-- Button used in controls with ClearStyle -->
	<Style x:Key="ClearStyleButtonStyle" TargetType="ButtonBase">
        <Setter Property="Padding" Value="3" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="ButtonBase">
					<Grid>
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal" />
								<VisualState x:Name="MouseOver">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
											<DiscreteObjectKeyFrame KeyTime="00:00:00">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Pressed">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PressedElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
											<DiscreteObjectKeyFrame KeyTime="00:00:00">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Disabled">
									<Storyboard>
										<DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="BackgroundElement" d:IsOptimized="True" />
										<DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True" />
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="CheckStates">
								<VisualState x:Name="Checked">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckedElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
											<DiscreteObjectKeyFrame KeyTime="00:00:00">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>	
								<VisualState x:Name="Unchecked" />
							</VisualStateGroup>
							<VisualStateGroup x:Name="FocusStates">
								<VisualState x:Name="Focused">
									<Storyboard>
										<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualElement" />
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Unfocused" />
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<c1:C1BrushBuilder x:Name="BackgroundBrush" Input="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}" DesignBrush="{StaticResource GeneralGradientBrush}" DesignColor="{StaticResource BaseColor}" />
						<c1:C1BrushBuilder x:Name="MouseOverBrush" Input="{TemplateBinding c1:ClearStyleExtensions.MouseOverBrush}" DesignBrush="{StaticResource GeneralGradientOverBrush}" DesignColor="{StaticResource MouseOverColor}" />
						<c1:C1BrushBuilder x:Name="PressedBrush" Input="{TemplateBinding c1:ClearStyleExtensions.PressedBrush}" DesignBrush="{StaticResource GeneralGradientSelectedBackground}" DesignColor="{StaticResource SelectedColor}" />
						<c1:C1BrushBuilder x:Name="CheckedBrush" Input="{TemplateBinding c1:ClearStyleExtensions.PressedBrush}" DesignBrush="{StaticResource GeneralGradientCheckedBrush}" DesignColor="{StaticResource SelectedColor}" />
						<c1:C1BrushBuilder x:Name="InnerBorderBrush" Input="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}" DesignBrush="{StaticResource InnerBorderBrush}" DesignColor="{StaticResource BaseColor}" />
						<c1:C1BrushBuilder x:Name="InnerBorderMouseOverBrush" Input="{TemplateBinding c1:ClearStyleExtensions.MouseOverBrush}" DesignBrush="{StaticResource InnerBorderMouseOverBrush}" DesignColor="{StaticResource MouseOverColor}" />
						<c1:C1BrushBuilder x:Name="InnerBorderPressedBrush" Input="{TemplateBinding c1:ClearStyleExtensions.PressedBrush}" DesignBrush="{StaticResource InnerBorderPressedBrush}" DesignColor="{StaticResource SelectedColor}" />
						<Border x:Name="BackgroundElement" Background="{Binding Output, ElementName=BackgroundBrush}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}">
							<Border BorderBrush="{Binding Output, ElementName=InnerBorderBrush}" BorderThickness="{StaticResource InnerBorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" />
						</Border>	
						<Border x:Name="CheckedElement" Background="{Binding Output, ElementName=CheckedBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" Visibility="Collapsed" />
						<Border x:Name="MouseOverElement" Background="{Binding Output, ElementName=MouseOverBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" Visibility="Collapsed">
							<Border BorderBrush="{Binding Output, ElementName=InnerBorderMouseOverBrush}" BorderThickness="{StaticResource InnerBorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" />
						</Border>
						<Border x:Name="PressedElement" Background="{Binding Output, ElementName=PressedBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" Visibility="Collapsed">
							<Border BorderBrush="{Binding Output, ElementName=InnerBorderPressedBrush}" BorderThickness="{StaticResource InnerBorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" />
						</Border>
								
						<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
						<Border x:Name="FocusVisualElement" BorderBrush="{TemplateBinding c1:ClearStyleExtensions.FocusBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding c1:ClearStyleExtensions.CornerRadius}" IsHitTestVisible="false" Opacity="0" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

    <!--******************** C1Button used in DropDown, ComboBox, FilePicker ********************-->

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

    <!-- Thickness @ C1Button -->
    <Thickness x:Key="C1ButtonBorderThickness">1 0 0 0</Thickness>
    <!-- Thickness @ C1Button -->
    <Thickness x:Key="C1ButtonInnerBorderThickness">1</Thickness>
    <!-- Right CornerRadius @ C1Button -->
    <CornerRadius x:Key="C1ButtonCornerRadius">0 2 2 0</CornerRadius>
    <!-- Left CornerRadius @ C1Button -->
    <CornerRadius x:Key="C1ButtonLeftCornerRadius">2 0 0 2</CornerRadius>
    <!-- CornerRadius @ C1Button Inner Element -->
    <CornerRadius x:Key="C1ButtonInnerCornerRadius">0,1,1,0</CornerRadius>

    <!-- Top CornerRadius @ Numeric C1Button -->
    <CornerRadius x:Key="C1ButtonTopCornerRadius">0 1 0 0</CornerRadius>
    <!-- Bottom CornerRadius @ Numeric C1Button -->
    <CornerRadius x:Key="C1ButtonBottomCornerRadius">0 0 1 0</CornerRadius>

    <!--C1Button -->
    <ControlTemplate x:Key="C1Button" TargetType="ButtonBase">
        <Grid Style="{StaticResource C1ButtonStyle}">
            <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" />
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Focused" />
                    <VisualState x:Name="Unfocused" />
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <c1:C1BrushBuilder x:Name="BackgroundBrush" Input="{TemplateBinding Background}" DesignBrush="{StaticResource GeneralGradientBrush}" DesignColor="{StaticResource BaseColor}" />
            <c1:C1BrushBuilder x:Name="MouseOverBrush" Input="{TemplateBinding c1:ClearStyleExtensions.MouseOverBrush}" DesignBrush="{StaticResource GeneralGradientOverBrush}" DesignColor="{StaticResource MouseOverColor}" />
            <c1:C1BrushBuilder x:Name="PressedBrush" Input="{TemplateBinding c1:ClearStyleExtensions.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 c1:ClearStyleExtensions.MouseOverBrush}" DesignBrush="{StaticResource InnerBorderMouseOverBrush}" DesignColor="{StaticResource MouseOverColor}" />
            <c1:C1BrushBuilder x:Name="InnerBorderPressedBrush" Input="{TemplateBinding c1:ClearStyleExtensions.PressedBrush}" DesignBrush="{StaticResource InnerBorderPressedBrush}" DesignColor="{StaticResource SelectedColor}" />
            <Border x:Name="BackgroundElement" Background="{Binding ElementName=BackgroundBrush, Path=Output}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{StaticResource C1ButtonBorderThickness}" CornerRadius="{StaticResource C1ButtonCornerRadius}">
                <Border BorderBrush="{Binding ElementName=InnerBorderBrush, Path=Output}" BorderThickness="{StaticResource C1ButtonInnerBorderThickness}" CornerRadius="{StaticResource C1ButtonInnerCornerRadius}" />
            </Border>
            <Border x:Name="MouseOverElement" Background="{Binding ElementName=MouseOverBrush, Path=Output}" BorderBrush="Transparent" BorderThickness="{StaticResource C1ButtonBorderThickness}" CornerRadius="{StaticResource C1ButtonCornerRadius}" Visibility="Collapsed">
                <Border BorderBrush="{Binding ElementName=InnerBorderMouseOverBrush, Path=Output}" BorderThickness="{StaticResource C1ButtonInnerBorderThickness}" CornerRadius="{StaticResource C1ButtonInnerCornerRadius}" />
            </Border>
            <Border x:Name="PressedElement" Background="{Binding ElementName=PressedBrush, Path=Output}" BorderBrush="Transparent" BorderThickness="{StaticResource C1ButtonInnerBorderThickness}" CornerRadius="{StaticResource C1ButtonCornerRadius}" Visibility="Collapsed">
                <Border BorderBrush="{Binding ElementName=InnerBorderPressedBrush, Path=Output}" BorderThickness="{StaticResource C1ButtonBorderThickness}" CornerRadius="{StaticResource C1ButtonInnerCornerRadius}" />
            </Border>
            <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
        </Grid>
    </ControlTemplate>
</ResourceDictionary>
