-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathControls.DatePicker.xaml
76 lines (63 loc) · 4.25 KB
/
Controls.DatePicker.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controlzex="urn:controlzex"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.Shared.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="MahApps.Styles.DatePicker" TargetType="{x:Type DatePicker}">
<Setter Property="Background" Value="Blue" />
<Setter Property="BorderBrush" Value="{DynamicResource MahApps.Brushes.TextBox.Border}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CalendarStyle" Value="{DynamicResource MahApps.Styles.Calendar.Base}" />
<Setter Property="ContextMenu" Value="{DynamicResource MahApps.TextBox.ContextMenu}" />
<Setter Property="FontFamily" Value="{DynamicResource MahApps.Fonts.Family.Control}" />
<Setter Property="FontSize" Value="{DynamicResource MahApps.Font.Size.Content}" />
<Setter Property="Foreground" Value="{DynamicResource MahApps.Brushes.Text}" />
<Setter Property="IsTodayHighlighted" Value="True" />
<Setter Property="MinHeight" Value="26" />
<Setter Property="Padding" Value="4" />
<Setter Property="SelectedDateFormat" Value="Short" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DatePicker}">
<Grid x:Name="PART_Root">
<Border x:Name="Base"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<Grid x:Name="PART_InnerGrid" Margin="{TemplateBinding BorderThickness}">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="TextColumn" Width="*" />
<ColumnDefinition x:Name="ClearButtonColumn" Width="Auto" />
<ColumnDefinition x:Name="ButtonColumn" Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition x:Name="ButtonRow" Height="*" />
</Grid.RowDefinitions>
<DatePickerTextBox x:Name="PART_TextBox"
Grid.Row="1"
Grid.Column="0"
Margin="0"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
CaretBrush="{DynamicResource MahApps.Brushes.ThemeForeground}"
ContextMenu="{TemplateBinding ContextMenu}"
Focusable="{TemplateBinding Focusable}"
FontSize="{TemplateBinding FontSize}"
Foreground="{TemplateBinding Foreground}"
SelectionBrush="{DynamicResource MahApps.Brushes.Highlight}">
</DatePickerTextBox>
</Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Validation.ErrorTemplate" Value="{DynamicResource MahApps.Templates.ValidationError}" />
</Style>
</ResourceDictionary>