<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:assist="clr-namespace:SmartUI.Assist">
    <PathGeometry x:Key="pathDate1">M544 703.872H612.48c10.24 0 17.152-7.04 17.152-17.728V615.36c0-10.624-6.848-17.664-17.152-17.664H544c-10.304 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.848 17.728 17.152 17.728z m0-176.96H612.48c10.24 0 17.152-7.04 17.152-17.728V438.4c0-10.624-6.848-17.664-17.152-17.664H544c-10.304 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.848 17.728 17.152 17.728z m171.392 0h68.608c10.24 0 17.152-7.04 17.152-17.728V438.4c0-10.624-6.912-17.664-17.152-17.664h-68.608c-10.24 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.912 17.728 17.152 17.728z m-342.848 0h68.608c10.24 0 17.088-7.04 17.088-17.728V438.4c0-10.624-6.848-17.664-17.088-17.664H372.48c-10.24 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.848 17.728 17.152 17.728z m342.848 176.96h68.608c10.24 0 17.152-7.04 17.152-17.728V615.36c0-10.624-6.912-17.664-17.152-17.664h-68.608c-10.24 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.912 17.728 17.152 17.728z m0 176.96h68.608c10.24 0 17.152-7.04 17.152-17.728V792.32c0-10.624-6.912-17.664-17.152-17.664h-68.608c-10.24 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.912 17.728 17.152 17.728z m-171.392 0H612.48c10.24 0 17.152-7.04 17.152-17.728V792.32c0-10.624-6.848-17.664-17.152-17.664H544c-10.304 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.848 17.728 17.152 17.728z m-342.848 0h68.544c10.24 0 17.152-7.04 17.152-17.728V792.32c0-10.624-6.848-17.664-17.152-17.664H201.152c-10.304 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.848 17.728 17.152 17.728z m0-176.96h68.544c10.24 0 17.152-7.04 17.152-17.728V615.36c0-10.624-6.848-17.664-17.152-17.664H201.152c-10.304 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.848 17.728 17.152 17.728z</PathGeometry>
    <PathGeometry x:Key="pathDate2">M904 84.48h-137.152V49.088c0-17.664-13.696-35.392-34.304-35.392-20.544 0-34.304 14.144-34.304 35.392v35.392H286.848V49.088c0-17.664-13.696-35.392-34.304-35.392-20.544 0-34.304 14.144-34.304 35.392v35.392H81.152c-37.76 0-68.608 31.872-68.608 70.784v778.624c0 38.976 30.848 70.784 68.608 70.784h822.848c37.76 0 68.544-31.808 68.544-70.784V155.264c0-38.912-30.848-70.784-68.544-70.784z m0 814.08c0 21.184-13.76 35.328-34.304 35.328H115.392c-20.544 0-34.24-14.144-34.24-35.392V349.952h822.848v548.544z m0-619.392H81.152V190.656c0-21.184 13.696-35.392 34.24-35.392H218.24v35.392c0 17.728 13.76 35.392 34.304 35.392 20.608 0 34.304-14.08 34.304-35.392v-35.392h411.392v35.392c0 17.728 13.76 35.392 34.304 35.392 20.608 0 34.304-14.08 34.304-35.392v-35.392h102.848c20.544 0 34.304 14.208 34.304 35.392v88.512z</PathGeometry>
    <PathGeometry x:Key="pathDate3">M201.152 526.912h68.544c10.24 0 17.152-7.04 17.152-17.728V438.4c0-10.624-6.848-17.664-17.152-17.664H201.152c-10.304 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.848 17.728 17.152 17.728z m171.392 176.96h68.608c10.24 0 17.088-7.04 17.088-17.728V615.36c0-10.624-6.848-17.664-17.088-17.664H372.48c-10.24 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.848 17.728 17.152 17.728z m0 176.96h68.608c10.24 0 17.088-7.04 17.088-17.728V792.32c0-10.624-6.848-17.664-17.088-17.664H372.48c-10.24 0-17.152 7.04-17.152 17.664v70.784c0 10.624 6.848 17.728 17.152 17.728z</PathGeometry>

    <Style x:Key="DatePickerDefault" TargetType="{x:Type DatePicker}">
        <Setter Property="Width" Value="200"/>
        <Setter Property="Height" Value="35"/>
        <Setter Property="BorderBrush" Value="{DynamicResource BorderBaseColor}"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="Validation.ErrorTemplate" Value="{x:Null}"/>
        <Setter Property="assist:DatePickerAssist.AutoClose" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DatePicker}">
                    <DockPanel LastChildFill="True">
                        <TextBlock  x:Name="errorMsg" Margin="5 2 5 -20" FontSize="12" Text="{TemplateBinding ToolTip}" Foreground="Red" DockPanel.Dock="Bottom" VerticalAlignment="Center"/>
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="4" Padding="{TemplateBinding Padding}">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_DisabledVisual"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <DockPanel x:Name="PART_Root" LastChildFill="True" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                <DockPanel.Resources>
                                    <SolidColorBrush x:Key="DisabledBrush" Color="#A5FFFFFF"/>
                                    <ControlTemplate x:Key="DropDownButtonTemplate" TargetType="{x:Type Button}">
                                        <!--<smart:PackIcon Kind="CalendarsTick" Width="20" Height="20" Foreground="{TemplateBinding Foreground}" VerticalAlignment="Center" HorizontalAlignment="Center"/>-->
                                        <Grid Width="20" Height="20" Background="Transparent">
                                            <Path Stretch="UniformToFill" Height="10" Width="14" Margin="0,0,0,2" VerticalAlignment="Bottom" Fill="{TemplateBinding Foreground}" Data="{DynamicResource pathDate1}"/>
                                            <Path Stretch="UniformToFill" Fill="{TemplateBinding Foreground}" Data="{DynamicResource pathDate2}"/>
                                            <Path Stretch="UniformToFill" Width="6" Height="10" Margin="3,6,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" Fill="{TemplateBinding Foreground}" Data="{DynamicResource pathDate3}"/>
                                        </Grid>
                                    </ControlTemplate>
                                </DockPanel.Resources>
                                <Button x:Name="PART_Button" DockPanel.Dock="Right" Grid.Column="1" Foreground="{TemplateBinding BorderBrush}" HorizontalAlignment="Left" Margin="3,0,3,0" Grid.Row="0" Template="{StaticResource DropDownButtonTemplate}" VerticalAlignment="Center" Width="30" MinWidth="30" Height="30"/>
                                <TextBox x:Name="PART_TextBox" Width="{TemplateBinding Width}" Grid.Column="0" Text="{Binding SelectedDate,StringFormat='yyyy-MM-dd',UpdateSourceTrigger=PropertyChanged,RelativeSource={RelativeSource Mode=TemplatedParent}}" BorderThickness="0" VerticalContentAlignment="Center" Padding="5 0" Grid.Row="0"  Style="{x:Null}"/>
                                <Grid x:Name="PART_DisabledVisual" Grid.ColumnSpan="2" Grid.Column="0" IsHitTestVisible="False" Opacity="0" Grid.Row="0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <Rectangle Grid.Column="0" Fill="#A5FFFFFF" RadiusY="1" Grid.Row="0" RadiusX="1"/>
                                    <Rectangle Grid.Column="1" Fill="#A5FFFFFF" Height="18" Margin="3,0,3,0" RadiusY="1" Grid.Row="0" RadiusX="1" Width="19"/>
                                    <Popup IsOpen="{TemplateBinding IsDropDownOpen}" AllowsTransparency="True" VerticalOffset="5" Placement="Bottom" PlacementTarget="{Binding ElementName=PART_TextBox}" StaysOpen="False">
                                        <Border Margin="8" Background="White">
                                            <Border.Effect>
                                                <DropShadowEffect Color="LightGray" Opacity="0.3" Direction="8"/>
                                            </Border.Effect>
                                            <Calendar Style="{DynamicResource CalendarDefaultStyle}" DisplayDateStart="{TemplateBinding DisplayDateStart}" DisplayDateEnd="{TemplateBinding DisplayDateEnd}" SelectedDate="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=SelectedDate,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
                                        </Border>                                        
                                    </Popup>
                                </Grid>
                            </DockPanel>
                        </Border>
                    </DockPanel>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="false">
                            <Setter Property="Foreground" TargetName="PART_TextBox" Value="{Binding Foreground, RelativeSource={RelativeSource TemplatedParent}}"/>
                        </DataTrigger>
                        <Trigger Property="ToolTip" Value="{x:Null}">
                            <Setter TargetName="errorMsg" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="Validation.HasError" Value="true">
                            <Setter Property="ToolTip" Value="{Binding RelativeSource=
                            {x:Static RelativeSource.Self}, 
                            Path=(Validation.Errors)[0].ErrorContent}"/>
                            <Setter Property="BorderBrush" Value="Red"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="{x:Type DatePicker}" BasedOn="{StaticResource DatePickerDefault}"/>
</ResourceDictionary>