RadPasswordBox
Represents a password input control that allows users to enter passwords securely. This control masks the input with a specified character (default is a bullet character '●'), and provides options to show the password through a button that toggles visibility. It also supports password-related events, including notifying when the password changes. The secure password is stored using SecureString to protect sensitive data against memory inspection. Additional features include customizable button content, and visibility controls for the password display button.
Definition
Namespace:Telerik.Windows.Controls
Assembly:Telerik.Windows.Controls.dll
Syntax:
[TelerikToolboxCategory("Input")]
public class RadPasswordBox : RadWatermarkTextBox
Inheritance: objectRadWatermarkTextBoxRadPasswordBox
Inherited Members
Constructors
Initializes a new instance of the RadPasswordBox class.
public RadPasswordBox()
Fields
IsPasswordVisibleProperty
DependencyProperty
Identifies the IsPasswordVisible dependency property.
public static readonly DependencyProperty IsPasswordVisibleProperty
PasswordChangedEvent
RoutedEvent
Identifies the PasswordChanged routed event.
public static readonly RoutedEvent PasswordChangedEvent
PasswordCharProperty
DependencyProperty
Identifies the PasswordChar dependency property.
public static readonly DependencyProperty PasswordCharProperty
ShowPasswordButtonContentProperty
DependencyProperty
Identifies the ShowPasswordButtonContent dependency property.
public static readonly DependencyProperty ShowPasswordButtonContentProperty
ShowPasswordButtonContentTemplateProperty
DependencyProperty
Identifies the ShowPasswordButtonContentTemplate dependency property.
public static readonly DependencyProperty ShowPasswordButtonContentTemplateProperty
ShowPasswordButtonVisibilityProperty
DependencyProperty
Identifies the ShowPasswordButtonVisibility dependency property.
public static readonly DependencyProperty ShowPasswordButtonVisibilityProperty
Properties
Gets value indicating whether the actual password is currently displayed.
public bool IsPasswordVisible { get; }
Gets or sets the current password as a string representation.
public string Password { get; set; }
Gets or sets the masking character for RadPasswordBox. The default value is a bullet character (●).
public char PasswordChar { get; set; }
Gets the current password as a SecureString.
public SecureString SecurePassword { get; }
Gets or sets the content to be shown in the button used to display the password at runtime.
public object ShowPasswordButtonContent { get; set; }
ShowPasswordButtonContentTemplate
DataTemplate
Gets or sets the template for presenting the content in the button used to display the password at runtime.
public DataTemplate ShowPasswordButtonContentTemplate { get; set; }
Gets or sets value indicating whether the button used to display the password should be visible. The default value is Auto.
public ShowPasswordButtonVisibilityMode ShowPasswordButtonVisibility { get; set; }
Methods
Clears the current Password.
public void Clear()
Called when the Clear command is invoked.
protected override void HandleClear()
Overrides:
Contains the logic for handling the preview key down event of RadPasswordBox.
protected virtual bool HandleKeyDown(Key key)
The key that has been pressed.
Returns:True if the KeyDown event should be handled, otherwise false.
When overridden in a derived class, measures the size in layout required for child elements and determines a size for the System.Windows.FrameworkElement-derived class.
protected override Size MeasureOverride(Size constraint)
A maximum Size to not exceed.
Returns:Size
When overridden in a derived class, is invoked whenever application code or internal processes call .
public override void OnApplyTemplate()
Overrides:
OnCreateAutomationPeer()
AutomationPeer
Returns class-specific System.Windows.Automation.Peers.AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.
protected override AutomationPeer OnCreateAutomationPeer()
AutomationPeer
Overrides:
Invoked when an unhandled System.Windows.DragDrop.DragEnter attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected override void OnDrop(DragEventArgs e)
The System.Windows.DragEventArgs that contains the event data.
Called when the Password changes and raises the PasswordChanged event.
protected virtual void OnPasswordChanged()
Virtual method reporting a key was pressed.
protected override void OnPreviewKeyDown(KeyEventArgs e)
Virtual method reporting text composition.
protected override void OnPreviewTextInput(TextCompositionEventArgs e)
Events
PasswordChanged
RoutedEventHandler
Occurs when the value of the Password property changes.
[SRCategory("Behavior")]
public event RoutedEventHandler PasswordChanged