<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:c1datetime="using:C1.Xaml.DateTimeEditors"
    xmlns:c1calendar="using:C1.Xaml.Calendar">
   <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="ms-appx:///C1.UWP/themes/C1Button.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    

    <!--******************  DatePicker ********************-->
    <SolidColorBrush x:Key="HighlightBorderThemeBrush" Color="{ThemeResource SystemColorHighlightColor}" />
    
    <Style TargetType="c1calendar:C1Calendar" x:Key="DatePickerCalendarStyle" >
        <Setter Property="RequestedTheme" Value="Light"/>
        <Setter Property="BorderThickness" Value="{ThemeResource ComboBoxPopupBorderThemeThickness}"/>
        <Setter Property="Background" Value="{ThemeResource ComboBoxPopupBackgroundThemeBrush}" />
        <Setter Property="Foreground" Value="{ThemeResource ComboBoxPopupForegroundThemeBrush}" />
        <Setter Property="BorderBrush" Value="{ThemeResource ComboBoxPopupBorderThemeBrush}"/>
        <Setter Property="MonthHeaderForeground" Value="{ThemeResource ComboBoxPopupForegroundThemeBrush}" />
        <Setter Property="WeekendBrush" Value="{ThemeResource ComboBoxPopupForegroundThemeBrush}" />
        <Setter Property="DisabledDayBrush" Value="{ThemeResource TextBoxDisabledForegroundThemeBrush}" />
        <Setter Property="AdjacentDayBrush" Value="{ThemeResource TextBoxDisabledForegroundThemeBrush}"/>
        <Setter Property="DayBorderBrush" Value="#28000000"/>
        <Setter Property="SelectedDayBrush" Value="#3e000000"/>
        <Setter Property="ShowTodayButton" Value="True"/>
        <Setter Property="Width" Value="310"/>
        <Setter Property="Height" Value="320"/>
    </Style>

    <!--******************* C1DatePicker ********************-->
    <ControlTemplate x:Key="C1DatePickerTemplate" TargetType="c1datetime:C1DatePicker">
        <Grid x:Name="Root" Margin="3">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.0" />
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="PointerOver">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="BackgroundElement"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Duration="0"
                                                         To="{ThemeResource TextControlPointerOverBackgroundThemeOpacity}" />
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundElement"
                                                                       Storyboard.TargetProperty="Background">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxPointerOverBackgroundThemeBrush}" />
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement"
                                                                       Storyboard.TargetProperty="BorderBrush">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxPointerOverBorderThemeBrush}" />
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Normal">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="BackgroundElement"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Duration="0"
                                                         To="{ThemeResource TextControlBackgroundThemeOpacity}" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Focused">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundElement"
                                                                       Storyboard.TargetProperty="Background">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxFocusedBackgroundThemeBrush}" />
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimation Storyboard.TargetName="FocusedBorderElement"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Duration="0"
                                                         To="{ThemeResource TextControlBackgroundThemeOpacity}" />
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Unfocused"/>
                </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>
            <Grid MinHeight="{TemplateBinding MinHeight}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Border x:Name="BackgroundElement"
                        Background="{TemplateBinding Background}"
                        Margin="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}"/>
                <Border x:Name="BorderElement"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}"/>
                <Border x:Name="FocusedBorderElement" Opacity="0"
                                BorderBrush="{TemplateBinding FocusBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}"/>
                <c1:C1MaskedTextBox x:Name="TextBox" 
						    MinWidth="60"
						    Foreground="{TemplateBinding Foreground}" 
    						Background="Transparent" 
                            BorderBrush="Transparent"
                            FontFamily="{TemplateBinding FontFamily}"
                            FontSize="{TemplateBinding FontSize}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            SelectOnFocus="Always"
							VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" 
							HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                            FocusCuesVisibility="Collapsed" 
						    DisabledCuesVisibility="Collapsed"
						    Padding="{TemplateBinding Padding}" />
                <Button x:Name="Button" Grid.Column="1" Padding="10, 8" 
                        Margin="3 -3 -3 -3" 
                        Background="{TemplateBinding ButtonBackground}"
                        Foreground="{TemplateBinding ButtonForeground}"
                        c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}"
                        c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        Style="{StaticResource ClearStyleButtonStyle}"
                        FontSize="18"
                        VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                        VerticalContentAlignment="Center" HorizontalContentAlignment="Center"                        
                        FontFamily="{ThemeResource SymbolThemeFontFamily}"
                        FontWeight="Bold" 
                        IsEnabled="{TemplateBinding IsEnabled}"
						IsTabStop="False"
						Content="&#57361;"/>
            </Grid>
            <Popup x:Name="Popup">
                <Popup.ChildTransitions>
                    <TransitionCollection>
                        <EntranceThemeTransition FromHorizontalOffset="0" FromVerticalOffset="-5"/>
                    </TransitionCollection>
                </Popup.ChildTransitions>
            </Popup>
            <Border x:Name="DisabledVisualElement" 
								    Background="{ThemeResource TextBoxDisabledBackgroundThemeBrush}"
								    IsHitTestVisible="False"
								    Opacity="0"
								    Visibility="{TemplateBinding DisabledCuesVisibility}"/>
            <c1:C1ValidationDecorator x:Name="ValidationDecorator" 
                                      Target="{Binding RelativeSource={RelativeSource TemplatedParent}}" 
                                      Style="{TemplateBinding ValidationDecoratorStyle}"/>
        </Grid>
    </ControlTemplate>

    <Style TargetType="c1datetime:C1DatePicker">
        <Setter Property="Foreground" Value="{ThemeResource TextBoxForegroundThemeBrush}" />
        <Setter Property="Background" Value="{ThemeResource TextBoxBackgroundThemeBrush}" />
        <Setter Property="BorderBrush" Value="{ThemeResource ComboBoxBorderThemeBrush}"/>
        <Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}"/>
        <Setter Property="ButtonBackground" Value="{ThemeResource ButtonBackgroundThemeBrush}"/>
        <Setter Property="ButtonForeground" Value="{ThemeResource ButtonForegroundThemeBrush}"/>
        <Setter Property="MouseOverBrush" Value="{ThemeResource ButtonPointerOverBackgroundThemeBrush}"/>
        <Setter Property="PressedBrush" Value="{ThemeResource ButtonPressedBackgroundThemeBrush}" />
        <Setter Property="FocusBrush" Value="{ThemeResource ComboBoxFocusedBorderThemeBrush}"/>
        <Setter Property="MinWidth" Value="152" />
        <Setter Property="MinHeight" Value="{ThemeResource TextControlThemeMinHeight}"/>
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="Padding" Value="{ThemeResource TextControlThemePadding}" />
        <Setter Property="Template" Value="{StaticResource C1DatePickerTemplate}"/>
        <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
        <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
        <Setter Property="CalendarStyle" Value="{StaticResource DatePickerCalendarStyle}"/>
    </Style>

    <!--******************* C1TimeEditor ********************-->

    <!-- TimeEditor Default Style -->
    <Style TargetType="c1datetime:C1TimeEditor">
        <Setter Property="Foreground" Value="{ThemeResource TextBoxForegroundThemeBrush}"/>
        <Setter Property="Background" Value="{ThemeResource TextBoxBackgroundThemeBrush}"/>
        <Setter Property="BorderBrush" Value="{ThemeResource ComboBoxBorderThemeBrush}"/>
        <Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}"/>
        <Setter Property="ButtonBackground" Value="{ThemeResource ButtonBackgroundThemeBrush}"/>
        <Setter Property="ButtonForeground" Value="{ThemeResource ButtonForegroundThemeBrush}"/>
        <Setter Property="MouseOverBrush" Value="{ThemeResource ButtonPointerOverBackgroundThemeBrush}"/>
        <Setter Property="PressedBrush" Value="{ThemeResource ButtonPressedBackgroundThemeBrush}" />
        <Setter Property="FocusBrush" Value="{ThemeResource ComboBoxFocusedBorderThemeBrush}"/>
        <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
        <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="Padding" Value="{ThemeResource TextControlThemePadding}" />
        <Setter Property="MinWidth" Value="180" />
        <Setter Property="MinHeight" Value="{ThemeResource TextControlThemeMinHeight}"/>
        <Setter Property="Interval" Value="33" />
        <Setter Property="Delay" Value="500" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1datetime:C1TimeEditor">
                    <Grid x:Name="Root" Margin="3">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="BackgroundElement"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Duration="0"
                                                         To="{ThemeResource TextControlPointerOverBackgroundThemeOpacity}" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundElement"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxPointerOverBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement"
                                                                       Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxPointerOverBorderThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="BackgroundElement"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Duration="0"
                                                         To="{ThemeResource TextControlBackgroundThemeOpacity}" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundElement"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxFocusedBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="FocusedBorderElement"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Duration="0"
                                                         To="{ThemeResource TextControlBackgroundThemeOpacity}" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ButtonsVisibilityStates">
                                <VisualState x:Name="HideButtons">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Increase" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Decrease" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ShowButtons">
                                    <Storyboard />
                                </VisualState>
                            </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>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Border x:Name="BackgroundElement"
                                Background="{TemplateBinding Background}"
                                Margin="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}"/>
                            <Border x:Name="BorderElement"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}"/>
                            <Border x:Name="FocusedBorderElement" Opacity="0"
                                BorderBrush="{TemplateBinding FocusBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}"/>
                            <c1:C1MaskedTextBox x:Name="TextBox" Grid.Column="0" 
									Foreground="{TemplateBinding Foreground}" 
									Background="Transparent" 
                                    BorderBrush="Transparent"
                                    FontFamily="{TemplateBinding FontFamily}"
                                    FontSize="{TemplateBinding FontSize}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    SelectOnFocus="Always"
									VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" 
									HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
									Text="" 
                                    MinHeight="{TemplateBinding MinHeight}"
                                    FocusCuesVisibility="Collapsed" 
									DisabledCuesVisibility="Collapsed" 
									Padding="{TemplateBinding Padding}" />
                            <RepeatButton x:Name="Decrease" Grid.Column="1" 
										  Delay="{TemplateBinding Delay}" 
										  Interval="{TemplateBinding Interval}"
										  IsTabStop="False" 
										  Background="{TemplateBinding ButtonBackground}"
                                          Margin="3 -3 0 -3"
                                          Foreground="{TemplateBinding ButtonForeground}"
                                          c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}"
                                          c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}"
                                          BorderBrush="{TemplateBinding BorderBrush}"
                                          BorderThickness="{TemplateBinding BorderThickness}"
                                          VerticalAlignment="Stretch"
                                          VerticalContentAlignment="Center"
                                          Style="{StaticResource ClearStyleButtonStyle}"
                                          FontSize="24"
                                          Padding="14 -7 14 0"
                                          Content="-"/>
                            <RepeatButton x:Name="Increase" Grid.Column="2"  
    									  Delay="{TemplateBinding Delay}" 
										  Interval="{TemplateBinding Interval}"
										  IsTabStop="False" 
                                          Margin="0 -3 -3 -3" 
                                          Background="{TemplateBinding ButtonBackground}"
                                          Foreground="{TemplateBinding ButtonForeground}"
                                          c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}"
                                          c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}"
                                          BorderBrush="{TemplateBinding BorderBrush}"
                                          BorderThickness="{TemplateBinding BorderThickness}"
                                          VerticalAlignment="Stretch"
                                          VerticalContentAlignment="Center"
                                          Style="{StaticResource ClearStyleButtonStyle}"
                                          FontSize="24"
                                          Padding="12 -7 12 0"
                                          Content="+"/>
                            <Border x:Name="DisabledVisualElement" Grid.ColumnSpan="3"
								    Background="{ThemeResource TextBoxDisabledBackgroundThemeBrush}"
								    IsHitTestVisible="False"
								    Opacity="0"
								    Visibility="{TemplateBinding DisabledCuesVisibility}"
                                    c1:ClearStyleExtensions.CornerRadius="{TemplateBinding CornerRadius}"/>
                        </Grid>
                        <c1:C1ValidationDecorator x:Name="ValidationDecorator" 
                                                  Target="{Binding RelativeSource={RelativeSource TemplatedParent}}" 
                                                  Style="{TemplateBinding ValidationDecoratorStyle}" 
                                                  />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--******************** C1DateTimePicker ********************-->

    <!-- C1DateTimePicker Default -->
    <Style TargetType="c1datetime:C1DateTimePicker">
        <Setter Property="Foreground" Value="{ThemeResource TextBoxForegroundThemeBrush}"/>
        <Setter Property="Background" Value="{ThemeResource TextBoxBackgroundThemeBrush}"/>
        <Setter Property="BorderBrush" Value="{ThemeResource ComboBoxBorderThemeBrush}"/>
        <Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}"/>
        <Setter Property="ButtonBackground" Value="{ThemeResource ButtonBackgroundThemeBrush}"/>
        <Setter Property="ButtonForeground" Value="{ThemeResource ButtonForegroundThemeBrush}"/>
        <Setter Property="MouseOverBrush" Value="{ThemeResource ButtonPointerOverBackgroundThemeBrush}"/>
        <Setter Property="PressedBrush" Value="{ThemeResource ButtonPressedBackgroundThemeBrush}" />
        <Setter Property="FocusBrush" Value="{ThemeResource ComboBoxFocusedBorderThemeBrush}" />
        <Setter Property="Padding" Value="{ThemeResource TextControlThemePadding}" />
        <Setter Property="MinTimeEditorWidth" Value="180" />
        <Setter Property="MinDatePickerWidth" Value="152" />
        <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
        <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1datetime:C1DateTimePicker">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement2" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="PointerOver"/>
                            </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>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <c1datetime:C1DatePicker x:Name="DatePicker" Grid.Column="0" DisabledCuesVisibility="Collapsed" 
                                                MinWidth="{Binding MinDatePickerWidth, RelativeSource={RelativeSource TemplatedParent}}"
												AllowNull="{Binding AllowNull, RelativeSource={RelativeSource TemplatedParent}}"
												IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
												Prompt="{Binding Prompt, RelativeSource={RelativeSource TemplatedParent}}"
												Watermark="{Binding DateWatermark, RelativeSource={RelativeSource TemplatedParent}}"
												Mask="{Binding DateMask, RelativeSource={RelativeSource TemplatedParent}}"
												CustomFormat="{Binding CustomDateFormat, RelativeSource={RelativeSource TemplatedParent}}"
												SelectedDateFormat="{Binding DateFormat, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
											    BorderBrush="{TemplateBinding BorderBrush}"
                                                CornerRadius="{TemplateBinding CornerRadius}"
											    BorderThickness="{TemplateBinding BorderThickness}"
											    Foreground="{TemplateBinding Foreground}"
												MouseOverBrush="{TemplateBinding MouseOverBrush}"
												PressedBrush="{TemplateBinding PressedBrush}"
 												FocusBrush="{TemplateBinding FocusBrush}"
                                                FontFamily="{TemplateBinding FontFamily}"
                                                FontSize="{TemplateBinding FontSize}"
                                                FocusCuesVisibility="{TemplateBinding FocusCuesVisibility}"
												ButtonBackground="{TemplateBinding ButtonBackground}"
												ButtonForeground="{TemplateBinding ButtonForeground}"
											    Padding="{TemplateBinding Padding}" 
											    Background="{TemplateBinding Background}"
											    HorizontalAlignment="Stretch" 
											    VerticalAlignment="Stretch"
											    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
											    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        <c1datetime:C1TimeEditor x:Name="TimeEditor" Grid.Column="1" DisabledCuesVisibility="Collapsed"
                                                Increment="{Binding TimeIncrement, RelativeSource={RelativeSource TemplatedParent}}"
                                                MinWidth="{Binding MinTimeEditorWidth, RelativeSource={RelativeSource TemplatedParent}}"
												AllowNull="{Binding AllowNull, RelativeSource={RelativeSource TemplatedParent}}"
												IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
												Prompt="{Binding Prompt, RelativeSource={RelativeSource TemplatedParent}}"
												Watermark="{Binding TimeWatermark, RelativeSource={RelativeSource TemplatedParent}}"
												Mask="{Binding TimeMask, RelativeSource={RelativeSource TemplatedParent}}"
												CustomFormat="{Binding CustomTimeFormat, RelativeSource={RelativeSource TemplatedParent}}"
												Format="{Binding TimeFormat, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
												BorderBrush="{TemplateBinding BorderBrush}"
                                                CornerRadius="{TemplateBinding CornerRadius}"
												BorderThickness="{TemplateBinding BorderThickness}"
												Foreground="{TemplateBinding Foreground}"
												MouseOverBrush="{TemplateBinding MouseOverBrush}"
												PressedBrush="{TemplateBinding PressedBrush}"
 												FocusBrush="{TemplateBinding FocusBrush}"
                                                FontFamily="{TemplateBinding FontFamily}"
                                                FontSize="{TemplateBinding FontSize}"
                                                FocusCuesVisibility="{TemplateBinding FocusCuesVisibility}"
												ButtonBackground="{TemplateBinding ButtonBackground}"
												ButtonForeground="{TemplateBinding ButtonForeground}"
												Padding="{TemplateBinding Padding}" 
												Background="{TemplateBinding Background}"
												HorizontalAlignment="Stretch" 
												VerticalAlignment="Stretch"
												HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
												VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        <Border x:Name="DisabledVisualElement" 
					            Background="{ThemeResource TextBoxDisabledBackgroundThemeBrush}"
					            IsHitTestVisible="False"
                                Visibility="Collapsed" />
                        <Border x:Name="DisabledVisualElement2" 
					            Background="{ThemeResource TextBoxDisabledBackgroundThemeBrush}"
					            IsHitTestVisible="False"
                                Visibility="Collapsed" 
                                Margin="3,0,0,0"
                                Grid.Column="1"/>
                        <c1:C1ValidationDecorator x:Name="ValidationDecorator" 
                                                  Target="{Binding RelativeSource={RelativeSource TemplatedParent}}" 
                                                  Style="{TemplateBinding ValidationDecoratorStyle}" 
                                                  Grid.ColumnSpan="2"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
