PasswordBox
Description
PasswordBoxExtensions adds Fluent placeholder, reveal, and feedback properties to native PasswordBox. The screenshots show PasswordBoxExtensions inside PasswordBox.
The images show the styled PasswordBox with its placeholder.
Example usage
- XAML
- C#
<PasswordBox fluence:PasswordBoxExtensions.PlaceholderText="Password"
fluence:PasswordBoxExtensions.RevealButtonEnabled="True" />
var password = new System.Windows.Controls.PasswordBox();
Fluence.Wpf.Controls.PasswordBoxExtensions.SetPlaceholderText(password, "Password");
Key properties
| Property | Default | Purpose |
|---|---|---|
PlaceholderText | Empty string | Placeholder shown for an empty password. |
CornerRadius | 4 | Rounds the password field. |
RevealButtonEnabled | true | Enables the reveal button. |
ShowCapsLockIndicator | false | Shows the Caps Lock indicator. |
ShowPasswordStrength | false | Shows the strength indicator. |
PasswordStrength | 0 | Value used by the strength indicator. |
State and behavior
The reveal button shows the password while the pointer holds it down. Keyboard activation toggles the reveal state. Set fluence:PasswordBoxExtensions.RevealButtonEnabled="False" to disable the reveal action and clear any displayed password.
Events
The native PasswordChanged event reports changes to the password.
Related
See text input focus and selection for the shared WPF editor behavior.