50
50
<Setter Property =" Template" >
51
51
<Setter .Value>
52
52
<ControlTemplate TargetType =" {x:Type PasswordBox}" >
53
- <Grid >
54
- <Border x : Name =" border"
55
- BorderBrush =" {TemplateBinding BorderBrush}"
56
- BorderThickness =" {TemplateBinding BorderThickness}"
57
- Background =" {TemplateBinding Background}"
58
- SnapsToDevicePixels =" True"
59
- Padding =" 0 4 0 4" >
60
- <Grid Margin =" {TemplateBinding Padding}"
61
- VerticalAlignment =" {TemplateBinding VerticalContentAlignment}"
62
- HorizontalAlignment =" {TemplateBinding HorizontalContentAlignment}" >
63
- <ScrollViewer x : Name =" PART_ContentHost" Focusable =" false"
64
- HorizontalScrollBarVisibility =" Hidden" VerticalScrollBarVisibility =" Hidden"
65
- SnapsToDevicePixels =" {TemplateBinding SnapsToDevicePixels}"
66
- UseLayoutRounding =" {TemplateBinding UseLayoutRounding}"
67
- />
68
- <wpf : SmartHint x : Name =" Hint"
69
- Hint =" {Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource TemplatedParent}}"
70
- HintProxy =" {Binding RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static converters:HintProxyFabricConverter.Instance}}"
71
- HintOpacity =" {Binding Path=(wpf:HintAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}"
72
- UseFloating =" {Binding Path=(wpf:HintAssist.IsFloating), RelativeSource={RelativeSource TemplatedParent}}"
73
- FloatingScale =" {Binding Path=(wpf:HintAssist.FloatingScale), RelativeSource={RelativeSource TemplatedParent}}"
74
- FloatingOffset =" {Binding Path=(wpf:HintAssist.FloatingOffset), RelativeSource={RelativeSource TemplatedParent}}"
75
- FontSize =" {TemplateBinding FontSize}"
76
- Padding =" {TemplateBinding Padding}"
77
- />
78
- </Grid >
79
- </Border >
80
- <Line x : Name =" DashedLine" VerticalAlignment =" Bottom" Visibility =" {Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Converter={StaticResource InverseBoolToVisConverter}}"
53
+ <Border x : Name =" passwordFieldBoxBorder"
54
+ SnapsToDevicePixels =" True" >
55
+ <Grid >
56
+ <Border x : Name =" border"
57
+ BorderBrush =" {TemplateBinding BorderBrush}"
58
+ BorderThickness =" {TemplateBinding BorderThickness}"
59
+ Background =" {TemplateBinding Background}"
60
+ SnapsToDevicePixels =" True"
61
+ Padding =" 0 4 0 4" >
62
+ <Grid x : Name =" passwordFieldGrid"
63
+ Margin =" {TemplateBinding Padding}"
64
+ VerticalAlignment =" {TemplateBinding VerticalContentAlignment}"
65
+ HorizontalAlignment =" {TemplateBinding HorizontalContentAlignment}" >
66
+ <ScrollViewer x : Name =" PART_ContentHost" Focusable =" false"
67
+ HorizontalScrollBarVisibility =" Hidden" VerticalScrollBarVisibility =" Hidden"
68
+ SnapsToDevicePixels =" {TemplateBinding SnapsToDevicePixels}"
69
+ UseLayoutRounding =" {TemplateBinding UseLayoutRounding}"
70
+ />
71
+ <wpf : SmartHint x : Name =" Hint"
72
+ Hint =" {Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource TemplatedParent}}"
73
+ HintProxy =" {Binding RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static converters:HintProxyFabricConverter.Instance}}"
74
+ HintOpacity =" {Binding Path=(wpf:HintAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}"
75
+ UseFloating =" {Binding Path=(wpf:HintAssist.IsFloating), RelativeSource={RelativeSource TemplatedParent}}"
76
+ FloatingScale =" {Binding Path=(wpf:HintAssist.FloatingScale), RelativeSource={RelativeSource TemplatedParent}}"
77
+ FloatingOffset =" {Binding Path=(wpf:HintAssist.FloatingOffset), RelativeSource={RelativeSource TemplatedParent}}"
78
+ FontSize =" {TemplateBinding FontSize}"
79
+ Padding =" {TemplateBinding Padding}"
80
+ />
81
+ </Grid >
82
+ </Border >
83
+ <Line x : Name =" DashedLine" VerticalAlignment =" Bottom" Visibility =" Hidden"
81
84
StrokeThickness =" 1.25" StrokeDashArray =" 1,2.5" StrokeDashCap =" Round"
82
85
X1 =" 0" X2 =" {Binding ActualWidth, ElementName=border}" Y1 =" 0" Y2 =" 0"
83
86
Stroke =" {TemplateBinding BorderBrush}" Opacity =" 0.56" />
84
- <wpf : Underline x : Name =" Underline" Visibility =" {Binding Path=(wpf:TextFieldAssist.DecorationVisibility), RelativeSource={RelativeSource TemplatedParent}}" />
85
- </Grid >
87
+ <wpf : Underline x : Name =" Underline" Visibility =" {Binding Path=(wpf:TextFieldAssist.DecorationVisibility), RelativeSource={RelativeSource TemplatedParent}}" />
88
+ </Grid >
89
+ </Border >
86
90
<ControlTemplate .Triggers>
87
91
<MultiTrigger >
88
92
<MultiTrigger .Conditions>
109
113
<Setter Property =" BorderBrush" Value =" {DynamicResource ValidationErrorBrush}" />
110
114
<Setter TargetName =" Underline" Property =" Background" Value =" {DynamicResource ValidationErrorBrush}" />
111
115
</Trigger >
116
+ <Trigger Property =" wpf:TextFieldAssist.HasTextFieldBox" Value =" True" >
117
+ <Setter Property =" VerticalContentAlignment" Value =" Top" />
118
+ <Setter TargetName =" passwordFieldBoxBorder" Property =" Background" Value =" {DynamicResource MaterialDesignTextFieldBoxBackground}" />
119
+ <Setter TargetName =" passwordFieldBoxBorder" Property =" CornerRadius" Value =" 4" />
120
+ <Setter TargetName =" passwordFieldBoxBorder" Property =" Padding" Value =" 0,8,0,0" />
121
+ <Setter TargetName =" passwordFieldGrid" Property =" Margin" Value =" 16,0,16,0" />
122
+ <Setter TargetName =" border" Property =" BorderThickness" Value =" 0" />
123
+ <Setter TargetName =" Underline" Property =" CornerRadius" Value =" 0,0,4,4" />
124
+ <Setter TargetName =" Hint" Property =" Margin" Value =" 0,0,0,16" />
125
+ <Setter TargetName =" PART_ContentHost" Property =" Margin" Value =" 0,8,0,8" />
126
+ </Trigger >
127
+ <Trigger Property =" wpf:TextFieldAssist.HasTextAreaBox" Value =" True" >
128
+ <Setter Property =" VerticalContentAlignment" Value =" Top" />
129
+ <Setter TargetName =" passwordFieldBoxBorder" Property =" Background" Value =" Transparent" />
130
+ <Setter TargetName =" passwordFieldBoxBorder" Property =" CornerRadius" Value =" 4" />
131
+ <Setter TargetName =" passwordFieldBoxBorder" Property =" BorderThickness" Value =" 1" />
132
+ <Setter TargetName =" passwordFieldBoxBorder" Property =" BorderBrush" Value =" {DynamicResource MaterialDesignTextAreaBorder}" />
133
+ <Setter TargetName =" passwordFieldBoxBorder" Property =" Padding" Value =" 0,8,0,0" />
134
+ <Setter TargetName =" passwordFieldBoxBorder" Property =" Margin" Value =" -1" />
135
+ <Setter TargetName =" passwordFieldGrid" Property =" Margin" Value =" 16,0,16,0" />
136
+ <Setter TargetName =" border" Property =" BorderThickness" Value =" 0" />
137
+ <Setter TargetName =" Underline" Property =" Visibility" Value =" Collapsed" />
138
+ <Setter TargetName =" Hint" Property =" Margin" Value =" 0,0,0,16" />
139
+ <Setter TargetName =" PART_ContentHost" Property =" Margin" Value =" 0,8,0,8" />
140
+ </Trigger >
141
+ <MultiTrigger >
142
+ <MultiTrigger .Conditions>
143
+ <Condition Property =" IsEnabled" Value =" false" />
144
+ <Condition Property =" wpf:TextFieldAssist.HasTextAreaBox" Value =" True" />
145
+ </MultiTrigger .Conditions>
146
+ <Setter TargetName =" passwordFieldBoxBorder" Property =" Background" Value =" {DynamicResource MaterialDesignTextFieldBoxDisabledBackground}" />
147
+ <Setter TargetName =" passwordFieldBoxBorder" Property =" BorderBrush" Value =" {DynamicResource MaterialDesignTextAreaInactiveBorder}" />
148
+ </MultiTrigger >
149
+ <MultiTrigger >
150
+ <MultiTrigger .Conditions>
151
+ <Condition Property =" IsEnabled" Value =" false" />
152
+ <Condition Property =" wpf:TextFieldAssist.HasTextAreaBox" Value =" False" />
153
+ </MultiTrigger .Conditions>
154
+ <Setter Property =" Opacity" TargetName =" border" Value =" 0.42" />
155
+ <Setter TargetName =" border" Property =" BorderBrush" Value =" Transparent" />
156
+ </MultiTrigger >
157
+ <MultiTrigger >
158
+ <MultiTrigger .Conditions>
159
+ <Condition Property =" IsEnabled" Value =" false" />
160
+ <Condition Property =" wpf:TextFieldAssist.HasTextAreaBox" Value =" False" />
161
+ <Condition Property =" wpf:TextFieldAssist.HasTextFieldBox" Value =" False" />
162
+ </MultiTrigger .Conditions>
163
+ <Setter TargetName =" DashedLine" Property =" Visibility" Value =" Visible" />
164
+ </MultiTrigger >
165
+ <MultiTrigger >
166
+ <MultiTrigger .Conditions>
167
+ <Condition Property =" IsMouseOver" Value =" True" />
168
+ <Condition Property =" wpf:TextFieldAssist.HasTextAreaBox" Value =" True" />
169
+ </MultiTrigger .Conditions>
170
+ <Setter TargetName =" passwordFieldBoxBorder" Property =" Margin" Value =" -2" />
171
+ <Setter TargetName =" passwordFieldBoxBorder" Property =" BorderThickness" Value =" 2" />
172
+ </MultiTrigger >
173
+ <MultiTrigger >
174
+ <MultiTrigger .Conditions>
175
+ <Condition Property =" IsKeyboardFocused" Value =" True" />
176
+ <Condition Property =" wpf:TextFieldAssist.HasTextAreaBox" Value =" True" />
177
+ </MultiTrigger .Conditions>
178
+ <Setter TargetName =" passwordFieldBoxBorder" Property =" Margin" Value =" -2" />
179
+ <Setter TargetName =" passwordFieldBoxBorder" Property =" BorderThickness" Value =" 2" />
180
+ <Setter TargetName =" passwordFieldBoxBorder" Property =" BorderBrush" Value =" {DynamicResource PrimaryHueMidBrush}" />
181
+ </MultiTrigger >
182
+ <MultiTrigger >
183
+ <MultiTrigger .Conditions>
184
+ <Condition Property =" Validation.HasError" Value =" True" />
185
+ <Condition Property =" wpf:TextFieldAssist.HasTextAreaBox" Value =" True" />
186
+ </MultiTrigger .Conditions>
187
+ <Setter TargetName =" passwordFieldBoxBorder" Property =" Margin" Value =" -2" />
188
+ <Setter TargetName =" passwordFieldBoxBorder" Property =" BorderThickness" Value =" 2" />
189
+ <Setter TargetName =" passwordFieldBoxBorder" Property =" BorderBrush" Value =" {DynamicResource ValidationErrorBrush}" />
190
+ </MultiTrigger >
112
191
</ControlTemplate .Triggers>
113
192
</ControlTemplate >
114
193
</Setter .Value>
128
207
<Setter Property =" wpf:HintAssist.IsFloating" Value =" True" />
129
208
</Style >
130
209
131
- </ResourceDictionary >
210
+ <Style x : Key =" MaterialDesignPasswordFieldBoxPasswordBox" TargetType =" {x:Type PasswordBox}" BasedOn =" {StaticResource MaterialDesignFloatingHintPasswordBox}" >
211
+ <Setter Property =" wpf:TextFieldAssist.HasTextFieldBox" Value =" True" />
212
+ </Style >
213
+
214
+ </ResourceDictionary >
0 commit comments