-
Notifications
You must be signed in to change notification settings - Fork 3.4k
/
MaterialDesignTheme.TextBox.xaml
514 lines (493 loc) · 37.8 KB
/
MaterialDesignTheme.TextBox.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
<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:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<converters:TextFieldClearButtonVisibilityConverter x:Key="ClearButtonVisibilityConverter" />
<converters:TextFieldPrefixTextVisibilityConverter x:Key="PrefixTextVisibilityConverter" />
<converters:NotConverter x:Key="NotConverter" />
<converters:MathConverter x:Key="MathMultiplyConverter" Operation="Multiply" />
<converters:FloatingHintOffsetCalculationConverter x:Key="FloatingHintOffsetCalculationConverter" />
<Style x:Key="MaterialDesignCharacterCounterTextBlock" TargetType="TextBlock" BasedOn="{StaticResource {x:Type TextBlock}}">
<Setter Property="FontSize" Value="10" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Opacity" Value="0.56" />
<Setter Property="Margin" Value="0,0,16,0" />
<Setter Property="Visibility" Value="{Binding Path=(wpf:TextFieldAssist.CharacterCounterVisibility), RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type TextBox}}}" />
<Setter Property="Text">
<Setter.Value>
<MultiBinding StringFormat="{}{0} / {1}">
<Binding Path="Text.Length" RelativeSource="{RelativeSource FindAncestor, AncestorType=TextBoxBase}" />
<Binding Path="MaxLength" RelativeSource="{RelativeSource FindAncestor, AncestorType=TextBoxBase}" />
</MultiBinding>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="MaterialDesignHelperTextBlock" TargetType="TextBlock" BasedOn="{StaticResource {x:Type TextBlock}}">
<Setter Property="FontSize" Value="{Binding Path=(wpf:HintAssist.HelperTextFontSize), RelativeSource={RelativeSource Mode=TemplatedParent}}" />
<Setter Property="Opacity" Value="{Binding Path=(wpf:HintAssist.HintOpacity), RelativeSource={RelativeSource Mode=TemplatedParent}}" />
<Setter Property="Text" Value="{Binding Path=(wpf:HintAssist.HelperText), RelativeSource={RelativeSource Mode=TemplatedParent}}" />
</Style>
<Style x:Key="MaterialDesignTextBoxBase" TargetType="{x:Type TextBoxBase}">
<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="{DynamicResource 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="wpf:TextFieldAssist.IncludeSpellingSuggestions" Value="{Binding RelativeSource={RelativeSource Self}, Path=(SpellCheck.IsEnabled)}" />
<Setter Property="wpf:TextFieldAssist.CharacterCounterStyle" Value="{StaticResource MaterialDesignCharacterCounterTextBlock}" />
<Setter Property="wpf:TextFieldAssist.CharacterCounterVisibility" Value="Visible" />
<Setter Property="wpf:HintAssist.HelperTextStyle" Value="{StaticResource MaterialDesignHelperTextBlock}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBoxBase}">
<Grid>
<VisualStateManager.VisualStateGroups>
<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 Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<wpf:PackIcon
Grid.Column="0"
x:Name="LeadingPackIcon"
Margin="0 0 6 0"
VerticalAlignment="Center"
Height="{TemplateBinding wpf:TextFieldAssist.LeadingIconSize}"
Width="{TemplateBinding wpf:TextFieldAssist.LeadingIconSize}"
Opacity="{TemplateBinding wpf:HintAssist.HintOpacity}"
Visibility="{TemplateBinding wpf:TextFieldAssist.HasLeadingIcon, Converter={StaticResource BooleanToVisibilityConverter}}"
Kind="{TemplateBinding wpf:TextFieldAssist.LeadingIcon}" />
<Grid
Grid.Column="1"
x:Name="grid"
MinWidth="1">
<Grid
Grid.Column="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Column="0"
x:Name="PrefixTextBlock"
Margin="0 0 2 0"
FontSize="{TemplateBinding FontSize}"
Opacity="{TemplateBinding wpf:HintAssist.HintOpacity}"
Text="{TemplateBinding wpf:TextFieldAssist.PrefixText}">
<TextBlock.Visibility>
<MultiBinding Converter="{StaticResource PrefixTextVisibilityConverter}">
<Binding ElementName="Hint" Path="IsHintInFloatingPosition" />
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(wpf:TextFieldAssist.PrefixText)" />
</MultiBinding>
</TextBlock.Visibility>
</TextBlock>
<ScrollViewer
Grid.Column="1"
x:Name="PART_ContentHost"
Panel.ZIndex="1"
Focusable="false"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden"
VerticalAlignment="Bottom"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
UseLayoutRounding="{TemplateBinding UseLayoutRounding}"
wpf:ScrollViewerAssist.IgnorePadding="True" />
<TextBlock
x:Name="SuffixTextBlock"
Grid.Column="2"
FontSize="{TemplateBinding FontSize}"
Opacity="{TemplateBinding wpf:HintAssist.HintOpacity}"
Text="{TemplateBinding wpf:TextFieldAssist.SuffixText}" />
</Grid>
<wpf:SmartHint
x:Name="Hint"
Grid.Column="0"
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>
</Grid>
<wpf:PackIcon
Grid.Column="2"
x:Name="TrailingPackIcon"
Margin="4 0 0 0"
VerticalAlignment="Center"
Height="{TemplateBinding wpf:TextFieldAssist.TrailingIconSize}"
Width="{TemplateBinding wpf:TextFieldAssist.TrailingIconSize}"
Opacity="{TemplateBinding wpf:HintAssist.HintOpacity}"
Visibility="{TemplateBinding wpf:TextFieldAssist.HasTrailingIcon, Converter={StaticResource BooleanToVisibilityConverter}}"
Kind="{TemplateBinding wpf:TextFieldAssist.TrailingIcon}" />
<Button
Grid.Column="2"
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">
<Grid Canvas.Top="2"
x:Name="FooterGrid"
Width="{Binding ActualWidth, ElementName=border}">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock
x:Name="HelperTextTextBlock"
Style="{Binding Path=(wpf:HintAssist.HelperTextStyle), RelativeSource={RelativeSource TemplatedParent}}" />
<Border Grid.Column="1" x:Name="CharacterCounterContainer">
<TextBlock
x:Name="CharacterCounterTextBlock"
Style="{Binding Path=(wpf:TextFieldAssist.CharacterCounterStyle), RelativeSource={RelativeSource TemplatedParent}}"/>
</Border>
</Grid>
</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 12 8" />
<Setter Property="Background" Value="{DynamicResource MaterialDesignTextFieldBoxBackground}" />
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
<Setter TargetName="HelperTextTextBlock" Property="Margin" Value="16 0 0 0" />
</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 16 12 16" />
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
<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="Padding" />
</MultiBinding>
</Setter.Value>
</Setter>
<Setter TargetName="HelperTextTextBlock" Property="Margin" Value="16 0 0 0" />
</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>
<DataTrigger Value="0">
<DataTrigger.Binding>
<PriorityBinding>
<Binding Path="MaxLength" RelativeSource="{RelativeSource Self}" FallbackValue="0" />
<Binding Source="0" />
</PriorityBinding>
</DataTrigger.Binding>
<Setter Property="Visibility" Value="Collapsed" TargetName="CharacterCounterContainer"/>
</DataTrigger>
<!-- 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.HasFilledTextField" Value="False" />
<Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="False" />
<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.HasFilledTextField" Value="False" />
<Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="False" />
<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}" />
<Setter Property="Margin" Value="0,0,1,0" TargetName="FooterGrid" />
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsInactiveSelectionHighlightEnabled" Value="true"/>
<Condition Property="IsSelectionActive" Value="false"/>
</MultiTrigger.Conditions>
<Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
</MultiTrigger>
</Style.Triggers>
</Style>
<Style x:Key="MaterialDesignTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource MaterialDesignTextBoxBase}" />
<Style x:Key="MaterialDesignFloatingHintTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource MaterialDesignTextBox}">
<Setter Property="wpf:HintAssist.IsFloating" Value="True" />
</Style>
<Style x:Key="MaterialDesignFilledTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource MaterialDesignFloatingHintTextBox}">
<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="MaterialDesignOutlinedTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource MaterialDesignFloatingHintTextBox}">
<Setter Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
<Setter Property="wpf:TextFieldAssist.TextFieldCornerRadius" Value="4" />
</Style>
</ResourceDictionary>