Update PasswordBox.cs

This commit is contained in:
chenjie02_cd committed 2021-09-06 20:10:33 +08:00
1 parent f6f167221d
commit fbaeb194e8
1 file changed
+5 -3
@@ -367,7 +367,7 @@ namespace HandyControl.Controls
private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e) private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e)
{ {
if (VerifyData() && !IsSafeEnabled) if (!IsSafeEnabled)
{ {
SetCurrentValue(UnsafePasswordProperty, ActualPasswordBox.Password); SetCurrentValue(UnsafePasswordProperty, ActualPasswordBox.Password);
@@ -376,17 +376,19 @@ namespace HandyControl.Controls
_textBox.Text = ActualPasswordBox.Password; _textBox.Text = ActualPasswordBox.Password;
} }
} }
VerifyData();
} }
private void TextBox_TextChanged(object sender, TextChangedEventArgs e) private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
{ {
VerifyData();
if (!IsSafeEnabled && ShowPassword) if (!IsSafeEnabled && ShowPassword)
{ {
Password = _textBox.Text; Password = _textBox.Text;
SetCurrentValue(UnsafePasswordProperty, Password); SetCurrentValue(UnsafePasswordProperty, Password);
} }
VerifyData();
} }
} }
} }