11
11
<converters : TextFieldHintVisibilityConverter x : Key =" TextFieldHintVisibilityConverter" />
12
12
13
13
<Style x : Key =" MaterialDesignDatePickerTextBox" TargetType =" {x:Type DatePickerTextBox}" >
14
- <Setter Property =" Foreground" Value =" {Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}" />
15
- <Setter Property =" wpf:TextFieldAssist.TextBoxViewMargin" Value =" 0 0 0 0" />
16
- <Setter Property =" Background" Value =" Transparent" />
17
- <Setter Property =" CaretBrush" Value =" {Binding RelativeSource={RelativeSource Self}, Path=BorderBrush}" />
18
- <Setter Property =" ScrollViewer.PanningMode" Value =" VerticalFirst" />
19
- <Setter Property =" Stylus.IsFlicksEnabled" Value =" False" />
20
- <Setter Property =" Template" >
21
- <Setter .Value>
22
- <ControlTemplate TargetType =" {x:Type DatePickerTextBox}" >
23
- <Grid >
24
- <Grid .Resources>
25
- <SolidColorBrush x : Key =" WatermarkBrush" Color =" {TemplateBinding Foreground}" />
26
- </Grid .Resources>
27
- <VisualStateManager .VisualStateGroups>
28
- <VisualStateGroup x : Name =" CommonStates" >
29
- <VisualStateGroup .Transitions>
30
- <VisualTransition GeneratedDuration =" 0" />
31
- <VisualTransition GeneratedDuration =" 0:0:0.1" To =" MouseOver" />
32
- </VisualStateGroup .Transitions>
33
- <VisualState x : Name =" Normal" />
34
- <VisualState x : Name =" MouseOver" />
35
- </VisualStateGroup >
36
- <VisualStateGroup x : Name =" WatermarkStates" >
37
- <VisualStateGroup .Transitions>
38
- <VisualTransition GeneratedDuration =" 0" />
39
- </VisualStateGroup .Transitions>
40
- <VisualState x : Name =" Unwatermarked" />
41
- <VisualState x : Name =" Watermarked" >
42
- <Storyboard >
43
- <DoubleAnimation Duration =" 0" To =" .23" Storyboard.TargetProperty=" Opacity" Storyboard.TargetName=" PART_Watermark" />
44
- </Storyboard >
45
- </VisualState >
46
- </VisualStateGroup >
47
- <VisualStateGroup x : Name =" FocusStates" >
48
- <VisualStateGroup .Transitions>
49
- <VisualTransition GeneratedDuration =" 0" />
50
- </VisualStateGroup .Transitions>
51
- <VisualState x : Name =" Unfocused" />
52
- <VisualState x : Name =" Focused" />
53
- </VisualStateGroup >
54
- </VisualStateManager .VisualStateGroups>
14
+ <Setter Property =" Foreground" Value =" {Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}" />
15
+ <Setter Property =" wpf:TextFieldAssist.TextBoxViewMargin" Value =" 0 0 0 0" />
16
+ <Setter Property =" Background" Value =" Transparent" />
17
+ <Setter Property =" CaretBrush" Value =" {Binding RelativeSource={RelativeSource Self}, Path=BorderBrush}" />
18
+ <Setter Property =" ScrollViewer.PanningMode" Value =" VerticalFirst" />
19
+ <Setter Property =" Stylus.IsFlicksEnabled" Value =" False" />
20
+ <Setter Property =" Template" >
21
+ <Setter .Value>
22
+ <ControlTemplate TargetType =" {x:Type DatePickerTextBox}" >
23
+ <Grid >
24
+ <Grid .Resources>
25
+ <SolidColorBrush x : Key =" WatermarkBrush" Color =" {TemplateBinding Foreground}" />
26
+ </Grid .Resources>
27
+ <VisualStateManager .VisualStateGroups>
28
+ <VisualStateGroup x : Name =" CommonStates" >
29
+ <VisualStateGroup .Transitions>
30
+ <VisualTransition GeneratedDuration =" 0" />
31
+ <VisualTransition GeneratedDuration =" 0:0:0.1" To =" MouseOver" />
32
+ </VisualStateGroup .Transitions>
33
+ <VisualState x : Name =" Normal" />
34
+ <VisualState x : Name =" MouseOver" />
35
+ </VisualStateGroup >
36
+ <VisualStateGroup x : Name =" WatermarkStates" >
37
+ <VisualStateGroup .Transitions>
38
+ <VisualTransition GeneratedDuration =" 0" />
39
+ </VisualStateGroup .Transitions>
40
+ <VisualState x : Name =" Unwatermarked" />
41
+ <VisualState x : Name =" Watermarked" >
42
+ <Storyboard >
43
+ <DoubleAnimation Duration =" 0" To =" .23" Storyboard.TargetProperty=" Opacity" Storyboard.TargetName=" PART_Watermark" />
44
+ </Storyboard >
45
+ </VisualState >
46
+ </VisualStateGroup >
47
+ <VisualStateGroup x : Name =" FocusStates" >
48
+ <VisualStateGroup .Transitions>
49
+ <VisualTransition GeneratedDuration =" 0" />
50
+ </VisualStateGroup .Transitions>
51
+ <VisualState x : Name =" Unfocused" />
52
+ <VisualState x : Name =" Focused" />
53
+ </VisualStateGroup >
54
+ </VisualStateManager .VisualStateGroups>
55
55
<Grid x : Name =" WatermarkContent" HorizontalAlignment =" {TemplateBinding HorizontalContentAlignment}" VerticalAlignment =" {TemplateBinding VerticalContentAlignment}" >
56
56
<wpf : SmartHint x : Name =" Hint"
57
57
FontSize =" {TemplateBinding FontSize}"
58
58
UseFloating =" {Binding Path=(wpf:HintAssist.IsFloating), RelativeSource={RelativeSource TemplatedParent}}"
59
59
Hint =" {Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource TemplatedParent}}"
60
60
HintProxy =" {Binding RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static converters:HintProxyFabricConverter.Instance}}"
61
- HintOpacity =" {Binding Path=(wpf:HintAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}" />
62
- <ContentControl x : Name =" PART_Watermark" Focusable =" False" IsHitTestVisible =" False" Opacity =" 0" Visibility =" Collapsed" />
63
- <ScrollViewer x : Name =" PART_ContentHost" HorizontalContentAlignment =" {TemplateBinding HorizontalContentAlignment}" Margin =" 0" VerticalContentAlignment =" {TemplateBinding VerticalContentAlignment}" />
64
- </Grid >
61
+ HintOpacity =" {Binding Path=(wpf:HintAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}" />
62
+ <ContentControl x : Name =" PART_Watermark" Focusable =" False" IsHitTestVisible =" False" Opacity =" 0" Visibility =" Collapsed" />
63
+ <ScrollViewer x : Name =" PART_ContentHost" HorizontalContentAlignment =" {TemplateBinding HorizontalContentAlignment}" Margin =" 0" VerticalContentAlignment =" {TemplateBinding VerticalContentAlignment}" />
64
+ </Grid >
65
65
</Grid >
66
66
<ControlTemplate .Triggers>
67
67
<MultiTrigger >
74
74
</MultiTrigger >
75
75
</ControlTemplate .Triggers>
76
76
</ControlTemplate >
77
- </Setter .Value>
78
- </Setter >
77
+ </Setter .Value>
78
+ </Setter >
79
79
</Style >
80
80
81
81
<Style x : Key =" MaterialDesignDatePickerCalendarPortrait" TargetType =" {x:Type Calendar}" >
82
- <Setter Property =" Foreground" Value =" {DynamicResource MaterialDesignBody}" />
83
- <Setter Property =" Background" Value =" {DynamicResource MaterialDesignPaper}" />
84
- <Setter Property =" CalendarDayButtonStyle" Value =" {StaticResource MaterialDesignCalendarDayButton}" />
85
- <Setter Property =" CalendarButtonStyle" Value =" {StaticResource MaterialDesignCalendarButton}" />
86
- <Setter Property =" Template" >
87
- <Setter .Value>
88
- <ControlTemplate TargetType =" {x:Type Calendar}" >
82
+ <Setter Property =" Foreground" Value =" {DynamicResource MaterialDesignBody}" />
83
+ <Setter Property =" Background" Value =" {DynamicResource MaterialDesignPaper}" />
84
+ <Setter Property =" CalendarDayButtonStyle" Value =" {StaticResource MaterialDesignCalendarDayButton}" />
85
+ <Setter Property =" CalendarButtonStyle" Value =" {StaticResource MaterialDesignCalendarButton}" />
86
+ <Setter Property =" Template" >
87
+ <Setter .Value>
88
+ <ControlTemplate TargetType =" {x:Type Calendar}" >
89
89
<AdornerDecorator CacheMode =" {Binding RelativeSource={RelativeSource Self}, Path=(wpf:ShadowAssist.CacheMode)}" >
90
90
<Border Effect =" {DynamicResource MaterialDesignShadowDepth4}" Padding =" 16 8 16 24" >
91
- <CalendarItem x : Name =" PART_CalendarItem" BorderBrush =" {TemplateBinding BorderBrush}" Background =" {TemplateBinding Background}" Style =" {DynamicResource MaterialDesignCalendarItemPortrait}" />
92
- </Border >
91
+ <CalendarItem x : Name =" PART_CalendarItem" BorderBrush =" {TemplateBinding BorderBrush}" Background =" {TemplateBinding Background}" Style =" {DynamicResource MaterialDesignCalendarItemPortrait}" />
92
+ </Border >
93
93
</AdornerDecorator >
94
- </ControlTemplate >
95
- </Setter .Value>
96
- </Setter >
97
- </Style >
94
+ </ControlTemplate >
95
+ </Setter .Value>
96
+ </Setter >
97
+ </Style >
98
98
99
- <Style x : Key =" MaterialDesignDatePicker" TargetType =" {x:Type DatePicker}" >
100
- <Setter Property =" Foreground" Value =" {Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}" />
101
- <Setter Property =" BorderBrush" Value =" {DynamicResource MaterialDesignTextBoxBorder}" />
102
- <Setter Property =" Background" Value =" Transparent" />
103
- <Setter Property =" CalendarStyle" Value =" {StaticResource MaterialDesignDatePickerCalendarPortrait}" />
104
- <Setter Property =" IsTodayHighlighted" Value =" True" />
105
- <Setter Property =" SelectedDateFormat" Value =" Short" />
106
- <Setter Property =" BorderThickness" Value =" 0 0 0 1" />
107
- <Setter Property =" HorizontalContentAlignment" Value =" Stretch" />
99
+ <Style x : Key =" MaterialDesignDatePicker" TargetType =" {x:Type DatePicker}" >
100
+ <Setter Property =" Foreground" Value =" {Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}" />
101
+ <Setter Property =" BorderBrush" Value =" {DynamicResource MaterialDesignTextBoxBorder}" />
102
+ <Setter Property =" Background" Value =" Transparent" />
103
+ <Setter Property =" CalendarStyle" Value =" {StaticResource MaterialDesignDatePickerCalendarPortrait}" />
104
+ <Setter Property =" IsTodayHighlighted" Value =" True" />
105
+ <Setter Property =" SelectedDateFormat" Value =" Short" />
106
+ <Setter Property =" BorderThickness" Value =" 0 0 0 1" />
107
+ <Setter Property =" HorizontalContentAlignment" Value =" Stretch" />
108
108
<Setter Property =" Margin" Value =" 0 0 0 0" />
109
- <Setter Property =" Validation.ErrorTemplate" Value =" {StaticResource MaterialDesignValidationErrorTemplate}" />
109
+ <Setter Property =" Validation.ErrorTemplate" Value =" {StaticResource MaterialDesignValidationErrorTemplate}" />
110
110
<Setter Property =" Template" >
111
- <Setter .Value>
112
- <ControlTemplate TargetType =" {x:Type DatePicker}" >
111
+ <Setter .Value>
112
+ <ControlTemplate TargetType =" {x:Type DatePicker}" >
113
113
<Grid >
114
114
<Border BorderBrush =" {TemplateBinding BorderBrush}"
115
115
BorderThickness =" {TemplateBinding BorderThickness}"
119
119
SnapsToDevicePixels =" True" >
120
120
<VisualStateManager .VisualStateGroups>
121
121
<VisualStateGroup x : Name =" CommonStates" >
122
- <VisualState x : Name =" Normal" />
122
+ <VisualState x : Name =" Normal" />
123
123
<VisualState x : Name =" Disabled" >
124
124
<Storyboard >
125
- <DoubleAnimation Duration =" 0" To =" .56" Storyboard.TargetProperty=" Opacity" Storyboard.TargetName=" PART_Root" />
125
+ <DoubleAnimation Duration =" 0" To =" .56" Storyboard.TargetProperty=" Opacity" Storyboard.TargetName=" PART_Root" />
126
126
</Storyboard >
127
127
</VisualState >
128
128
</VisualStateGroup >
137
137
<VisualStateManager .VisualStateGroups>
138
138
<VisualStateGroup x : Name =" CommonStates" >
139
139
<VisualStateGroup .Transitions>
140
- <VisualTransition GeneratedDuration =" 0" />
141
- <VisualTransition GeneratedDuration =" 0:0:0.1" To =" MouseOver" />
142
- <VisualTransition GeneratedDuration =" 0:0:0.1" To =" Pressed" />
140
+ <VisualTransition GeneratedDuration =" 0" />
141
+ <VisualTransition GeneratedDuration =" 0:0:0.1" To =" MouseOver" />
142
+ <VisualTransition GeneratedDuration =" 0:0:0.1" To =" Pressed" />
143
143
</VisualStateGroup .Transitions>
144
- <VisualState x : Name =" Normal" />
145
- <VisualState x : Name =" MouseOver" />
146
- <VisualState x : Name =" Pressed" />
147
- <VisualState x : Name =" Disabled" />
144
+ <VisualState x : Name =" Normal" />
145
+ <VisualState x : Name =" MouseOver" />
146
+ <VisualState x : Name =" Pressed" />
147
+ <VisualState x : Name =" Disabled" />
148
148
</VisualStateGroup >
149
149
</VisualStateManager .VisualStateGroups>
150
150
<Viewbox >
156
156
</ControlTemplate >
157
157
</Grid .Resources>
158
158
<Grid .ColumnDefinitions>
159
- <ColumnDefinition Width =" *" />
160
- <ColumnDefinition Width =" Auto" />
159
+ <ColumnDefinition Width =" *" />
160
+ <ColumnDefinition Width =" Auto" />
161
161
</Grid .ColumnDefinitions>
162
162
<Button x : Name =" PART_Button"
163
163
Grid.Column=" 1"
176
176
VerticalContentAlignment =" Center"
177
177
Style =" {DynamicResource MaterialDesignDatePickerTextBox}"
178
178
HorizontalAlignment =" Stretch" />
179
- <Popup x : Name =" PART_Popup" AllowsTransparency =" True"
179
+ <Popup x : Name =" PART_Popup" AllowsTransparency =" True"
180
180
Placement =" Custom"
181
181
CustomPopupPlacementCallback =" {x:Static wpf:CustomPopupPlacementCallbackHelper.LargePopupCallback}"
182
182
PlacementTarget =" {Binding ElementName=PART_TextBox}" StaysOpen =" False"
183
- PopupAnimation =" Fade" />
183
+ PopupAnimation =" Fade" />
184
184
</Grid >
185
185
</Border >
186
- <wpf : Underline x : Name =" Underline" Visibility =" {Binding Path=(wpf:TextFieldAssist.DecorationVisibility), RelativeSource={RelativeSource TemplatedParent}}" />
186
+ <wpf : Underline x : Name =" Underline" Visibility =" {Binding Path=(wpf:TextFieldAssist.DecorationVisibility), RelativeSource={RelativeSource TemplatedParent}}" />
187
187
</Grid >
188
188
<ControlTemplate .Triggers>
189
- <Trigger Property =" IsEnabled" Value =" false" >
190
- <Setter Property =" Opacity" TargetName =" border" Value =" 0.56" />
191
- </Trigger >
192
- <Trigger Property =" IsMouseOver" Value =" true" >
193
- <Setter Property =" BorderBrush" Value =" {DynamicResource PrimaryHueMidBrush}" />
194
- </Trigger >
195
- <Trigger Property =" IsKeyboardFocusWithin" Value =" true" >
196
- <Setter TargetName =" Underline" Property =" IsActive" Value =" True" />
197
- <Setter Property =" BorderBrush" Value =" {DynamicResource PrimaryHueMidBrush}" />
198
- </Trigger >
199
- <Trigger Property =" Validation.HasError" Value =" true" >
200
- <Setter Property =" BorderBrush" Value =" {DynamicResource ValidationErrorBrush}" />
201
- <Setter TargetName =" Underline" Property =" Background" Value =" {DynamicResource ValidationErrorBrush}" />
202
- </Trigger >
203
- </ControlTemplate .Triggers>
204
- </ControlTemplate >
205
- </Setter .Value>
206
- </Setter >
207
- </Style >
189
+ <Trigger Property =" IsEnabled" Value =" false" >
190
+ <Setter Property =" Opacity" TargetName =" border" Value =" 0.56" />
191
+ </Trigger >
192
+ <Trigger Property =" IsMouseOver" Value =" true" >
193
+ <Setter Property =" BorderBrush" Value =" {DynamicResource PrimaryHueMidBrush}" />
194
+ </Trigger >
195
+ <Trigger Property =" IsKeyboardFocusWithin" Value =" true" >
196
+ <Setter TargetName =" Underline" Property =" IsActive" Value =" True" />
197
+ <Setter Property =" BorderBrush" Value =" {DynamicResource PrimaryHueMidBrush}" />
198
+ </Trigger >
199
+ <Trigger Property =" Validation.HasError" Value =" true" >
200
+ <Setter Property =" BorderBrush" Value =" {DynamicResource ValidationErrorBrush}" />
201
+ <Setter TargetName =" Underline" Property =" Background" Value =" {DynamicResource ValidationErrorBrush}" />
202
+ </Trigger >
203
+ <Trigger Property =" wpf:HintAssist.IsFloating" Value =" True" >
204
+ <Setter TargetName =" border" Property =" Margin" Value =" 0 12 0 0" />
205
+ </Trigger >
206
+ </ControlTemplate .Triggers>
207
+ </ControlTemplate >
208
+ </Setter .Value>
209
+ </Setter >
210
+ </Style >
208
211
209
212
<Style x : Key =" MaterialDesignFloatingHintDatePicker" TargetType =" {x:Type DatePicker}" BasedOn =" {StaticResource MaterialDesignDatePicker}" >
210
- <Setter Property =" wpf:HintAssist.IsFloating" Value =" True" />
213
+ <Setter Property =" wpf:HintAssist.IsFloating" Value =" True" />
211
214
</Style >
212
215
</ResourceDictionary >
0 commit comments