-
Notifications
You must be signed in to change notification settings - Fork 3.4k
/
MaterialDesignTheme.TimePicker.xaml
600 lines (586 loc) · 43.9 KB
/
MaterialDesignTheme.TimePicker.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf"
xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ValidationErrorTemplate.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Menu.xaml" />
</ResourceDictionary.MergedDictionaries>
<converters:TextFieldHintVisibilityConverter x:Key="TextFieldHintVisibilityConverter" />
<converters:MathConverter Operation="Divide" x:Key="DivisionMathConverter" />
<converters:TextFieldClearButtonVisibilityConverter x:Key="ClearButtonVisibilityConverter" />
<converters:NotConverter x:Key="NotConverter" />
<converters:MathConverter x:Key="MathMultiplyConverter" Operation="Multiply" />
<converters:FloatingHintOffsetCalculationConverter x:Key="FloatingHintOffsetCalculationConverter" />
<converters:PickerInnerPaddingConverter x:Key="PickerInnerPaddingConverter" />
<Style x:Key="MaterialDesignTimePickerTextBox" TargetType="{x:Type wpf:TimePickerTextBox}">
<Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}" />
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextBoxBorder}" />
<Setter Property="BorderThickness" Value="0 0 0 1"/>
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMargin}" />
<Setter Property="Background" Value="Transparent"/>
<Setter Property="CaretBrush" Value="{DynamicResource PrimaryHueMidBrush}" />
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Top"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="AllowDrop" Value="true"/>
<Setter Property="Padding" Value="{x:Static wpf:Constants.TextBoxDefaultPadding}" />
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
<Setter Property="Validation.ErrorTemplate" Value="{StaticResource MaterialDesignValidationErrorTemplate}"/>
<Setter Property="wpf:TextFieldAssist.UnderlineBrush" Value="{DynamicResource PrimaryHueMidBrush}" />
<Setter Property="wpf:HintAssist.Foreground" Value="{DynamicResource PrimaryHueMidBrush}" />
<Setter Property="ContextMenu" Value="{StaticResource MaterialDesignDefaultContextMenu}" />
<Setter Property="Cursor" Value="IBeam"/>
<Setter Property="KeyboardNavigation.TabNavigation" Value="Local"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type wpf:TimePickerTextBox}">
<Grid>
<Grid.Resources>
<SolidColorBrush x:Key="WatermarkBrush" Color="{TemplateBinding Foreground}" />
</Grid.Resources>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0" />
<VisualTransition GeneratedDuration="0:0:0.1" To="MouseOver" />
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver" />
</VisualStateGroup>
<VisualStateGroup x:Name="WatermarkStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0" />
</VisualStateGroup.Transitions>
<VisualState x:Name="Unwatermarked" />
<VisualState x:Name="Watermarked">
<Storyboard>
<DoubleAnimation Duration="0" To=".23" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Watermark" />
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<Storyboard TargetName="RippleOnFocusScaleTransform">
<DoubleAnimation Storyboard.TargetProperty="ScaleX" From="0" To="1" Duration="0:0:0.3">
<DoubleAnimation.EasingFunction>
<SineEase EasingMode="EaseOut" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation Storyboard.TargetProperty="ScaleY" From="0" To="1" Duration="0:0:0.3">
<DoubleAnimation.EasingFunction>
<SineEase EasingMode="EaseOut" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation Storyboard.TargetProperty="ScaleX" To="0" BeginTime="0:0:0.45" Duration="0" />
<DoubleAnimation Storyboard.TargetProperty="ScaleY" To="0" BeginTime="0:0:0.45" Duration="0" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unfocused">
<Storyboard TargetName="RippleOnFocusScaleTransform">
<DoubleAnimation Storyboard.TargetProperty="ScaleX" To="0" Duration="0" />
<DoubleAnimation Storyboard.TargetProperty="ScaleY" To="0" Duration="0" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{DynamicResource MaterialDesignTextFieldBoxHoverBackground}"
CornerRadius="{TemplateBinding wpf:TextFieldAssist.TextFieldCornerRadius}"
Visibility="{TemplateBinding wpf:TextFieldAssist.RippleOnFocusEnabled, Converter={StaticResource BooleanToVisibilityConverter}}"
RenderTransformOrigin="0.5,0.5">
<Border.RenderTransform>
<ScaleTransform x:Name="RippleOnFocusScaleTransform" ScaleX="0" ScaleY="0" />
</Border.RenderTransform>
</Border>
<AdornerDecorator>
<Border
x:Name="border"
Padding="{TemplateBinding Padding}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
CornerRadius="{TemplateBinding wpf:TextFieldAssist.TextFieldCornerRadius}"
SnapsToDevicePixels="True"
wpf:BottomDashedLineAdorner.Brush="{TemplateBinding BorderBrush}"
wpf:BottomDashedLineAdorner.Thickness="{TemplateBinding BorderThickness}">
<Grid
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid
x:Name="grid"
VerticalAlignment="Center"
MinWidth="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock
x:Name="PrefixTextBlock"
Grid.Column="0"
FontSize="{TemplateBinding FontSize}"
Opacity="{TemplateBinding wpf:HintAssist.HintOpacity}"
Text="{TemplateBinding wpf:TextFieldAssist.PrefixText}" />
<ContentControl
Grid.Column="1"
x:Name="PART_Watermark"
Focusable="False"
IsHitTestVisible="False"
Opacity="0"
Visibility="Collapsed" />
<ScrollViewer
x:Name="PART_ContentHost"
Grid.Column="1"
Panel.ZIndex="1"
Focusable="false"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
UseLayoutRounding="{TemplateBinding UseLayoutRounding}"
wpf:ScrollViewerAssist.IgnorePadding="True" />
<wpf:SmartHint
x:Name="Hint"
Grid.Column="1"
HintProxy="{Binding RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static converters:HintProxyFabricConverter.Instance}}"
FontSize="{TemplateBinding FontSize}"
FontFamily="{TemplateBinding wpf:HintAssist.FontFamily}"
HintOpacity="{TemplateBinding wpf:HintAssist.HintOpacity}"
UseFloating="{TemplateBinding wpf:HintAssist.IsFloating}"
FloatingScale="{TemplateBinding wpf:HintAssist.FloatingScale}"
FloatingOffset="{TemplateBinding wpf:HintAssist.FloatingOffset}"
Margin="{TemplateBinding wpf:TextFieldAssist.TextBoxViewMargin}">
<wpf:SmartHint.Hint>
<Border
x:Name="HintBackgroundBorder"
Background="{TemplateBinding wpf:HintAssist.Background}"
CornerRadius="2">
<ContentPresenter
x:Name="HintWrapper"
Content="{TemplateBinding wpf:HintAssist.Hint}" />
</Border>
</wpf:SmartHint.Hint>
</wpf:SmartHint>
<TextBlock
x:Name="SuffixTextBlock"
Grid.Column="2"
FontSize="{TemplateBinding FontSize}"
Opacity="{TemplateBinding wpf:HintAssist.HintOpacity}"
Text="{TemplateBinding wpf:TextFieldAssist.SuffixText}" />
</Grid>
<Button
Grid.Column="1"
x:Name="PART_ClearButton"
Height="Auto"
Padding="2 0 0 0"
Focusable="False"
Style="{DynamicResource MaterialDesignToolButton}">
<Button.Visibility>
<MultiBinding Converter="{StaticResource ClearButtonVisibilityConverter}">
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(wpf:TextFieldAssist.HasClearButton)" />
<Binding ElementName="Hint" Path="IsContentNullOrEmpty" />
</MultiBinding>
</Button.Visibility>
<wpf:PackIcon Margin="0" Kind="CloseCircle" />
</Button>
</Grid>
</Border>
</AdornerDecorator>
<Border
x:Name="borderUnderline"
Background="{TemplateBinding BorderBrush}"
Height="0"
CornerRadius="{TemplateBinding wpf:TextFieldAssist.UnderlineCornerRadius}"
Visibility="{TemplateBinding wpf:TextFieldAssist.DecorationVisibility}"
HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
SnapsToDevicePixels="True" />
<wpf:Underline
x:Name="Underline"
Visibility="{TemplateBinding wpf:TextFieldAssist.DecorationVisibility}"
CornerRadius="{TemplateBinding wpf:TextFieldAssist.UnderlineCornerRadius}"
Background="{TemplateBinding wpf:TextFieldAssist.UnderlineBrush}" />
<Canvas VerticalAlignment="Bottom">
<TextBlock
Canvas.Top="2"
FontSize="{TemplateBinding wpf:HintAssist.HelperTextFontSize}"
MaxWidth="{Binding ActualWidth, ElementName=border}"
Opacity="{TemplateBinding wpf:HintAssist.HintOpacity}"
Text="{TemplateBinding wpf:HintAssist.HelperText}" />
</Canvas>
</Grid>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="wpf:HintAssist.IsFloating" Value="True" />
<Condition Property="IsKeyboardFocused" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="Hint" Property="Foreground" Value="{Binding Path=(wpf:HintAssist.Foreground), RelativeSource={RelativeSource TemplatedParent}}" />
<Setter TargetName="Hint" Property="HintOpacity" Value="1" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="wpf:HintAssist.IsFloating" Value="True" />
<Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="Hint" Property="FloatingOffset">
<Setter.Value>
<MultiBinding Converter="{StaticResource FloatingHintOffsetCalculationConverter}">
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="FontFamily" />
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="FontSize" />
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(wpf:HintAssist.FloatingScale)" />
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(wpf:HintAssist.FloatingOffset)" />
</MultiBinding>
</Setter.Value>
</Setter>
<Setter TargetName="grid" Property="Margin">
<Setter.Value>
<MultiBinding Converter="{StaticResource FloatingHintOffsetCalculationConverter}">
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="FontFamily" />
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="FontSize" />
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(wpf:HintAssist.FloatingScale)" />
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(wpf:HintAssist.FloatingOffset)" />
</MultiBinding>
</Setter.Value>
</Setter>
</MultiTrigger>
<Trigger Property="wpf:TextFieldAssist.HasFilledTextField" Value="True">
<Setter Property="Padding" Value="16 8" />
<Setter Property="Background" Value="{DynamicResource MaterialDesignTextFieldBoxBackground}" />
</Trigger>
<Trigger Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True">
<Setter Property="VerticalContentAlignment" Value="Top" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextAreaBorder}" />
<Setter Property="Padding" Value="16" />
<Setter TargetName="Underline" Property="Visibility" Value="Collapsed" />
<Setter TargetName="Hint" Property="HintOpacity" Value="1" />
<Setter TargetName="HintWrapper" Property="Opacity"
Value="{Binding Path=(wpf:HintAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}" />
<Setter TargetName="Hint" Property="FloatingOffset">
<Setter.Value>
<MultiBinding Converter="{StaticResource FloatingHintOffsetCalculationConverter}">
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="FontFamily" />
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="FontSize" />
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(wpf:HintAssist.FloatingScale)" />
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(wpf:HintAssist.FloatingOffset)" />
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ActualHeight" />
</MultiBinding>
</Setter.Value>
</Setter>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
<Condition Property="wpf:HintAssist.IsFloating" Value="True" />
<Condition SourceName="Hint" Property="IsHintInFloatingPosition" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="HintBackgroundBorder" Property="Padding" Value="4, 0" />
<Setter Property="wpf:HintAssist.Background" Value="{DynamicResource MaterialDesignPaper}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
<Condition Property="wpf:HintAssist.IsFloating" Value="True" />
<Condition Property="IsKeyboardFocused" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="HintWrapper" Property="Opacity" Value="1" />
</MultiTrigger>
<!-- IsEnabled -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsEnabled" Value="False" />
<Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="border" Property="BorderBrush" Value="Transparent" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsEnabled" Value="False" />
<Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="False" />
<Condition Property="wpf:TextFieldAssist.HasFilledTextField" Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="grid" Property="Opacity" Value="{x:Static wpf:Constants.TextBoxNotEnabledOpacity}" />
<Setter TargetName="border" Property="wpf:BottomDashedLineAdorner.IsAttached" Value="True" />
<Setter TargetName="borderUnderline" Property="Height" Value="0" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsEnabled" Value="False" />
<Condition Property="wpf:TextFieldAssist.HasFilledTextField" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="border" Property="Opacity" Value="{x:Static wpf:Constants.TextBoxNotEnabledOpacity}" />
<Setter TargetName="borderUnderline" Property="Opacity" Value="{x:Static wpf:Constants.TextBoxNotEnabledOpacity}" />
<Setter TargetName="borderUnderline" Property="Height" Value="1" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsEnabled" Value="False" />
<Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextAreaInactiveBorder}" />
<Setter TargetName="PrefixTextBlock" Property="Opacity" Value="{x:Static wpf:Constants.TextBoxNotEnabledOpacity}" />
<Setter TargetName="PART_ContentHost" Property="Opacity" Value="{x:Static wpf:Constants.TextBoxNotEnabledOpacity}" />
<Setter TargetName="SuffixTextBlock" Property="Opacity" Value="{x:Static wpf:Constants.TextBoxNotEnabledOpacity}" />
<Setter TargetName="PART_ClearButton" Property="Opacity" Value="{x:Static wpf:Constants.TextBoxNotEnabledOpacity}" />
<Setter TargetName="HintWrapper" Property="Opacity">
<Setter.Value>
<Binding
Path="(wpf:HintAssist.HintOpacity)"
RelativeSource="{RelativeSource TemplatedParent}"
Converter="{StaticResource MathMultiplyConverter}"
ConverterParameter="{x:Static wpf:Constants.TextBoxNotEnabledOpacity}" />
</Setter.Value>
</Setter>
</MultiTrigger>
<!-- IsKeyboardFocused -->
<Trigger Property="IsKeyboardFocused" Value="True">
<Setter TargetName="Underline" Property="IsActive" Value="True" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsKeyboardFocused" Value="True" />
<Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="border" Property="Margin" Value="-1" />
<Setter Property="BorderThickness" Value="2" />
<Setter Property="BorderBrush" Value="{Binding Path=(wpf:TextFieldAssist.UnderlineBrush), RelativeSource={RelativeSource Self}}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsKeyboardFocused" Value="True" />
<Condition Property="wpf:TextFieldAssist.HasFilledTextField" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="borderUnderline" Property="Height" Value="2" />
</MultiTrigger>
<!-- IsMouseOver -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="wpf:TextFieldAssist.NewSpecHighlightingEnabled" Value="False" />
</MultiTrigger.Conditions>
<Setter Property="BorderBrush" Value="{Binding Path=(wpf:TextFieldAssist.UnderlineBrush), RelativeSource={RelativeSource Self}}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="wpf:TextFieldAssist.NewSpecHighlightingEnabled" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="border" Property="BorderThickness" Value="0,0,0,2" />
<Setter TargetName="border" Property="Padding" Value="0,4,0,3" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="wpf:TextFieldAssist.HasFilledTextField" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{DynamicResource MaterialDesignTextFieldBoxHoverBackground}" />
<Setter TargetName="borderUnderline" Property="Height" Value="1" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="border" Property="Margin" Value="-1" />
<Setter Property="BorderThickness" Value="2" />
</MultiTrigger>
<!-- Validation.HasError -->
<Trigger Property="Validation.HasError" Value="true">
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignValidationErrorBrush}"/>
<Setter TargetName="Underline" Property="Background" Value="{DynamicResource MaterialDesignValidationErrorBrush}"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Validation.HasError" Value="True" />
<Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="border" Property="Margin" Value="-1" />
<Setter Property="BorderThickness" Value="2" />
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignValidationErrorBrush}" />
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="MaterialDesignTimePicker" TargetType="{x:Type wpf:TimePicker}">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}"/>
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextBoxBorder}" />
<Setter Property="BorderThickness" Value="0 0 0 1"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Padding" Value="{x:Static wpf:Constants.TextBoxDefaultPadding}" />
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMargin}" />
<Setter Property="Validation.ErrorTemplate" Value="{StaticResource MaterialDesignValidationErrorTemplate}"/>
<Setter Property="wpf:TextFieldAssist.UnderlineBrush" Value="{DynamicResource PrimaryHueMidBrush}" />
<Setter Property="wpf:HintAssist.Foreground" Value="{DynamicResource PrimaryHueMidBrush}" />
<Setter Property="IsHeaderVisible" Value="True"/>
<Setter Property="ClockStyle" Value="{DynamicResource MaterialDesignClock}" />
<Setter Property="ClockHostContentControlStyle">
<Setter.Value>
<Style TargetType="{x:Type ContentControl}">
<Style.Setters>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ContentControl}">
<AdornerDecorator CacheMode="{Binding RelativeSource={RelativeSource Self}, Path=(wpf:ShadowAssist.CacheMode)}">
<Border Effect="{DynamicResource MaterialDesignShadowDepth4}" Padding="16 8 16 24">
<ContentPresenter Content="{TemplateBinding ContentControl.Content}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" />
</Border>
</AdornerDecorator>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style.Setters>
</Style>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type wpf:TimePicker}">
<ControlTemplate.Resources>
<ControlTemplate x:Key="ClockButtonTemplate" TargetType="{x:Type Button}">
<wpf:PackIcon
Kind="ClockOutline"
Foreground="{TemplateBinding Foreground}"
Background="Transparent"
VerticalAlignment="Center" />
</ControlTemplate>
</ControlTemplate.Resources>
<Grid x:Name="PART_Root">
<wpf:TimePickerTextBox
x:Name="PART_TextBox"
Grid.Column="0"
Grid.Row="0"
Focusable="{TemplateBinding Focusable}"
Style="{DynamicResource MaterialDesignTimePickerTextBox}"
VerticalContentAlignment="Center"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
BorderBrush="{TemplateBinding BorderBrush}"
wpf:HintAssist.IsFloating="{TemplateBinding wpf:HintAssist.IsFloating}"
wpf:HintAssist.FloatingScale="{TemplateBinding wpf:HintAssist.FloatingScale}"
wpf:HintAssist.FloatingOffset="{TemplateBinding wpf:HintAssist.FloatingOffset}"
wpf:HintAssist.Hint="{TemplateBinding wpf:HintAssist.Hint}"
wpf:HintAssist.HintOpacity="{TemplateBinding wpf:HintAssist.HintOpacity}"
wpf:HintAssist.Foreground="{TemplateBinding wpf:HintAssist.Foreground}"
wpf:HintAssist.HelperText="{TemplateBinding wpf:HintAssist.HelperText}"
wpf:HintAssist.HelperTextFontSize="{TemplateBinding wpf:HintAssist.HelperTextFontSize}"
wpf:TextFieldAssist.TextBoxViewMargin="{TemplateBinding wpf:TextFieldAssist.TextBoxViewMargin}"
wpf:TextFieldAssist.DecorationVisibility="{TemplateBinding wpf:TextFieldAssist.DecorationVisibility}"
wpf:TextFieldAssist.HasFilledTextField="{TemplateBinding wpf:TextFieldAssist.HasFilledTextField}"
wpf:TextFieldAssist.HasOutlinedTextField="{TemplateBinding wpf:TextFieldAssist.HasOutlinedTextField}"
wpf:TextFieldAssist.TextFieldCornerRadius="{TemplateBinding wpf:TextFieldAssist.TextFieldCornerRadius}"
wpf:TextFieldAssist.UnderlineCornerRadius="{TemplateBinding wpf:TextFieldAssist.UnderlineCornerRadius}"
wpf:TextFieldAssist.NewSpecHighlightingEnabled="{TemplateBinding wpf:TextFieldAssist.NewSpecHighlightingEnabled}"
wpf:TextFieldAssist.RippleOnFocusEnabled="{TemplateBinding wpf:TextFieldAssist.RippleOnFocusEnabled}"
wpf:TextFieldAssist.UnderlineBrush="{TemplateBinding wpf:TextFieldAssist.UnderlineBrush}"
wpf:TextFieldAssist.HasClearButton="{TemplateBinding wpf:TextFieldAssist.HasClearButton}"
wpf:TextFieldAssist.PrefixText="{TemplateBinding wpf:TextFieldAssist.PrefixText}"
wpf:TextFieldAssist.SuffixText="{TemplateBinding wpf:TextFieldAssist.SuffixText}">
<wpf:TimePickerTextBox.Padding>
<MultiBinding Converter="{StaticResource PickerInnerPaddingConverter}">
<Binding Path="Padding" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="ActualWidth" ElementName="PART_Button" Mode="OneWay" />
</MultiBinding>
</wpf:TimePickerTextBox.Padding>
</wpf:TimePickerTextBox>
<Button
x:Name="PART_Button"
Foreground="{TemplateBinding BorderBrush}"
Focusable="False"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Template="{StaticResource ClockButtonTemplate}"
Margin="{TemplateBinding Padding, Converter={StaticResource PickerInnerPaddingConverter}}"
Height="16" />
<Popup
x:Name="PART_Popup"
AllowsTransparency="True"
Placement="Custom"
CustomPopupPlacementCallback="{x:Static wpf:CustomPopupPlacementCallbackHelper.LargePopupCallback}"
PlacementTarget="{Binding ElementName=PART_TextBox}"
StaysOpen="False"
PopupAnimation="Fade" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="wpf:TextFieldAssist.HasFilledTextField" Value="True">
<Setter Property="Padding" Value="16 8" />
<Setter Property="Background" Value="{DynamicResource MaterialDesignTextFieldBoxBackground}" />
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
</Trigger>
<Trigger Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True">
<Setter Property="Padding" Value="16" />
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextAreaBorder}" />
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="wpf:TextFieldAssist.HasFilledTextField" Value="False" />
<Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="False" />
<Condition Property="IsMouseOver" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueMidBrush}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsEnabled" Value="True" />
<Condition SourceName="PART_Button" Property="IsMouseOver" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="PART_Button" Property="Foreground" Value="{DynamicResource PrimaryHueMidBrush}"/>
</MultiTrigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="PART_Button" Property="Opacity" Value="{x:Static wpf:Constants.TextBoxNotEnabledOpacity}"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsEnabled" Value="False" />
<Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="PART_TextBox" Property="BorderBrush" Value="{DynamicResource MaterialDesignTextAreaInactiveBorder}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition SourceName="PART_TextBox" Property="IsKeyboardFocused" Value="True" />
<Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="PART_TextBox" Property="BorderBrush" Value="{Binding Path=(wpf:TextFieldAssist.UnderlineBrush), RelativeSource={RelativeSource Self}}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="wpf:TextFieldAssist.HasFilledTextField" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{DynamicResource MaterialDesignTextFieldBoxHoverBackground}" />
</MultiTrigger>
<Trigger Property="Validation.HasError" Value="True">
<Setter TargetName="PART_TextBox" Property="wpf:ValidationAssist.HasError" Value="True" />
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignValidationErrorBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="MaterialDesignFloatingHintTimePicker" TargetType="{x:Type wpf:TimePicker}" BasedOn="{StaticResource MaterialDesignTimePicker}">
<Setter Property="wpf:HintAssist.IsFloating" Value="True" />
</Style>
<Style x:Key="MaterialDesignFilledTimePicker" TargetType="{x:Type wpf:TimePicker}" BasedOn="{StaticResource MaterialDesignFloatingHintTimePicker}">
<Setter Property="wpf:TextFieldAssist.HasFilledTextField" Value="True" />
<Setter Property="wpf:TextFieldAssist.RippleOnFocusEnabled" Value="True" />
<Setter Property="wpf:TextFieldAssist.TextFieldCornerRadius" Value="4,4,0,0" />
<Setter Property="wpf:TextFieldAssist.UnderlineCornerRadius" Value="0" />
</Style>
<Style x:Key="MaterialDesignOutlinedTimePicker" TargetType="{x:Type wpf:TimePicker}" BasedOn="{StaticResource MaterialDesignFloatingHintTimePicker}">
<Setter Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
<Setter Property="wpf:TextFieldAssist.TextFieldCornerRadius" Value="4" />
</Style>
</ResourceDictionary>