File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
MaterialDesignThemes.UITests/WPF/PasswordBoxes
MaterialDesignThemes.Wpf/Themes Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,28 @@ public async Task PasswordBox_WithBoundPasswordProperty_RespectsBinding()
163
163
Assert . Equal ( "2" , password2 ) ;
164
164
165
165
recorder . Success ( ) ;
166
- }
166
+ }
167
+
168
+ [ Fact ]
169
+ [ Description ( "Issue 2998" ) ]
170
+ public async Task PasswordBox_WithRevealStyle_RespectsMaxLength ( )
171
+ {
172
+ await using var recorder = new TestRecorder ( App ) ;
173
+
174
+ var grid = await LoadXaml < Grid > ( @"
175
+ <Grid Margin=""30"">
176
+ <PasswordBox MaxLength=""5"" Style=""{StaticResource MaterialDesignFloatingHintRevealPasswordBox}"" />
177
+ </Grid>" ) ;
178
+ var passwordBox = await grid . GetElement < PasswordBox > ( "/PasswordBox" ) ;
179
+ var revealPasswordTextBox = await passwordBox . GetElement < TextBox > ( "RevealPasswordTextBox" ) ;
180
+
181
+ int maxLength1 = await passwordBox . GetMaxLength ( ) ;
182
+ int maxLength2 = await revealPasswordTextBox . GetMaxLength ( ) ;
183
+
184
+ // Assert
185
+ Assert . Equal ( maxLength1 , maxLength2 ) ;
186
+
187
+ recorder . Success ( ) ;
188
+ }
167
189
}
168
190
}
Original file line number Diff line number Diff line change 634
634
Padding =" {Binding ElementName=PART_ContentHost, Path=Padding}"
635
635
CaretBrush =" {TemplateBinding CaretBrush}"
636
636
Cursor =" {TemplateBinding Cursor, Converter={StaticResource IBeamCursorConverter}}"
637
+ MaxLength =" {TemplateBinding MaxLength}"
637
638
Foreground =" {TemplateBinding Foreground}"
638
639
SelectionBrush =" {TemplateBinding SelectionBrush}"
639
640
SnapsToDevicePixels =" {TemplateBinding SnapsToDevicePixels}"
You can’t perform that action at this time.
0 commit comments