77
77
</Style .Triggers>
78
78
</Style >
79
79
80
+ <Style x : Key =" MaterialDesignFloatingHintPasswordBox" TargetType =" {x:Type PasswordBox}" BasedOn =" {StaticResource MaterialDesignPasswordBox}" >
81
+ <Setter Property =" Template" >
82
+ <Setter .Value>
83
+ <ControlTemplate TargetType =" PasswordBox" >
84
+ <Grid >
85
+ <VisualStateManager .VisualStateGroups>
86
+ <VisualStateGroup x : Name =" MaterialDesignStates" >
87
+ <VisualStateGroup .Transitions>
88
+ <VisualTransition From =" *" To =" MaterialDesignStateTextNotEmpty" >
89
+ <Storyboard >
90
+ <DoubleAnimation Storyboard.TargetProperty=" FontSize" Storyboard.TargetName=" Hint"
91
+ Duration =" 0:0:0.3" To =" 10" >
92
+ <DoubleAnimation .EasingFunction>
93
+ <SineEase EasingMode =" EaseOut" />
94
+ </DoubleAnimation .EasingFunction>
95
+ </DoubleAnimation >
96
+ <DoubleAnimation Storyboard.TargetProperty=" Opacity" Storyboard.TargetName=" Hint"
97
+ Duration =" 0:0:0.3" To =" 1" >
98
+ <DoubleAnimation .EasingFunction>
99
+ <SineEase EasingMode =" EaseOut" />
100
+ </DoubleAnimation .EasingFunction>
101
+ </DoubleAnimation >
102
+ <ThicknessAnimation Storyboard.TargetProperty=" (FrameworkElement.Margin)" Storyboard.TargetName=" Hint"
103
+ Duration =" 0:0:0.3" To =" 1,-16,1,0" >
104
+ <ThicknessAnimation .EasingFunction>
105
+ <SineEase EasingMode =" EaseOut" />
106
+ </ThicknessAnimation .EasingFunction>
107
+ </ThicknessAnimation >
108
+ </Storyboard >
109
+ </VisualTransition >
110
+ <VisualTransition From =" *" To =" MaterialDesignStateTextEmpty" >
111
+ <Storyboard >
112
+ <DoubleAnimation Storyboard.TargetProperty=" FontSize" Storyboard.TargetName=" Hint"
113
+ Duration =" 0:0:0.3" >
114
+ <DoubleAnimation .EasingFunction>
115
+ <SineEase EasingMode =" EaseOut" />
116
+ </DoubleAnimation .EasingFunction>
117
+ </DoubleAnimation >
118
+ <DoubleAnimation Storyboard.TargetProperty=" Opacity" Storyboard.TargetName=" Hint"
119
+ Duration =" 0:0:0.3" >
120
+ <DoubleAnimation .EasingFunction>
121
+ <SineEase EasingMode =" EaseOut" />
122
+ </DoubleAnimation .EasingFunction>
123
+ </DoubleAnimation >
124
+ <ThicknessAnimation Storyboard.TargetProperty=" (FrameworkElement.Margin)" Storyboard.TargetName=" Hint"
125
+ Duration =" 0:0:0.3" >
126
+ <ThicknessAnimation .EasingFunction>
127
+ <SineEase EasingMode =" EaseOut" />
128
+ </ThicknessAnimation .EasingFunction>
129
+ </ThicknessAnimation >
130
+ </Storyboard >
131
+ </VisualTransition >
132
+ </VisualStateGroup .Transitions>
133
+ <VisualState x : Name =" MaterialDesignStateTextNotEmpty" >
134
+ <Storyboard >
135
+ <DoubleAnimation Storyboard.TargetProperty=" FontSize" Storyboard.TargetName=" Hint"
136
+ Duration =" 0" To =" 10" />
137
+ <DoubleAnimation Storyboard.TargetProperty=" Opacity" Storyboard.TargetName=" Hint"
138
+ Duration =" 0" To =" 1" />
139
+ <ThicknessAnimation Storyboard.TargetProperty=" (FrameworkElement.Margin)" Storyboard.TargetName=" Hint"
140
+ Duration =" 0" To =" 1,-16,1,0" />
141
+ </Storyboard >
142
+ </VisualState >
143
+ <VisualState x : Name =" MaterialDesignStateTextEmpty" >
144
+ <Storyboard >
145
+ <DoubleAnimation Storyboard.TargetProperty=" FontSize" Storyboard.TargetName=" Hint"
146
+ Duration =" 0" />
147
+ <DoubleAnimation Storyboard.TargetProperty=" Opacity" Storyboard.TargetName=" Hint"
148
+ Duration =" 0" />
149
+ <ThicknessAnimation Storyboard.TargetProperty=" (FrameworkElement.Margin)" Storyboard.TargetName=" Hint"
150
+ Duration =" 0" />
151
+ </Storyboard >
152
+ </VisualState >
153
+ </VisualStateGroup >
154
+ </VisualStateManager .VisualStateGroups>
155
+ <Border x : Name =" border"
156
+ BorderBrush =" {TemplateBinding BorderBrush}"
157
+ BorderThickness =" {TemplateBinding BorderThickness}"
158
+ Background =" {TemplateBinding Background}"
159
+ SnapsToDevicePixels =" True"
160
+ Padding =" 0 4 0 4" >
161
+ <Grid Margin =" 0 12 0 0"
162
+ VerticalAlignment =" {TemplateBinding VerticalContentAlignment}"
163
+ HorizontalAlignment =" {TemplateBinding HorizontalContentAlignment}" >
164
+ <ScrollViewer x : Name =" PART_ContentHost" Focusable =" false"
165
+ HorizontalScrollBarVisibility =" Hidden" VerticalScrollBarVisibility =" Hidden"
166
+ SnapsToDevicePixels =" {TemplateBinding SnapsToDevicePixels}"
167
+ UseLayoutRounding =" {TemplateBinding UseLayoutRounding}"
168
+ />
169
+ <TextBlock Text =" {Binding Path=(wpf:TextFieldAssist.Hint), RelativeSource={RelativeSource TemplatedParent}}"
170
+ IsHitTestVisible =" False"
171
+ FontSize =" {TemplateBinding FontSize}"
172
+ HorizontalAlignment =" Left"
173
+ VerticalAlignment =" Top"
174
+ x : Name =" Hint"
175
+ Margin =" 1 0 1 0"
176
+ Opacity =" {Binding Path=(wpf:TextFieldAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}"
177
+ />
178
+ </Grid >
179
+ </Border >
180
+ <wpf : Underline x : Name =" Underline" />
181
+ </Grid >
182
+ <ControlTemplate .Triggers>
183
+ <MultiTrigger >
184
+ <MultiTrigger .Conditions>
185
+ <Condition Property =" wpf:PasswordFieldAssist.IsNullOrEmpty" Value =" False" />
186
+ <Condition Property =" IsKeyboardFocused" Value =" True" />
187
+ </MultiTrigger .Conditions>
188
+ <Setter TargetName =" Hint" Property =" Foreground" Value =" {DynamicResource PrimaryHueMidBrush}" />
189
+ </MultiTrigger >
190
+
191
+ <Trigger Property =" IsEnabled" Value =" false" >
192
+ <Setter Property =" Opacity" TargetName =" border" Value =" 0.56" />
193
+ </Trigger >
194
+
195
+ <Trigger Property =" IsMouseOver" Value =" true" >
196
+ <Setter Property =" BorderBrush" Value =" {DynamicResource PrimaryHueMidBrush}" />
197
+ </Trigger >
198
+
199
+ <Trigger Property =" IsKeyboardFocused" Value =" true" >
200
+ <Setter TargetName =" Underline" Property =" IsActive" Value =" True" />
201
+ </Trigger >
202
+
203
+ <Trigger Property =" Validation.HasError" Value =" true" >
204
+ <Setter Property =" BorderBrush" Value =" {DynamicResource ValidationErrorBrush}" />
205
+ <Setter TargetName =" Underline" Property =" Background" Value =" {DynamicResource ValidationErrorBrush}" />
206
+ </Trigger >
207
+ </ControlTemplate .Triggers>
208
+ </ControlTemplate >
209
+ </Setter .Value>
210
+ </Setter >
211
+ </Style >
212
+
80
213
</ResourceDictionary >
0 commit comments