Class PasswordBox
Represents a control for entering passwords.
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
public class PasswordBox : Control
Constructors
| Improve this Doc View SourcePasswordBox()
Declaration
public PasswordBox()
Fields
| Improve this Doc View SourceCaretBrushProperty
Declaration
[NotImplemented]
public static readonly DependencyProperty CaretBrushProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
MaxLengthProperty
Identifies the MaxLength dependency property.
Declaration
public static readonly DependencyProperty MaxLengthProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
PasswordCharProperty
The DependencyID for the PasswordChar property. Default Value: '●'
Declaration
public static readonly DependencyProperty PasswordCharProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
PasswordProperty
Identifies the Password dependency property.
Declaration
public static readonly DependencyProperty PasswordProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
SelectionBackgroundProperty
Declaration
[NotImplemented]
public static readonly DependencyProperty SelectionBackgroundProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
SelectionForegroundProperty
Identifies the SelectionForeground dependency property.
Declaration
[NotImplemented]
public static readonly DependencyProperty SelectionForegroundProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceCaretBrush
Gets or sets the brush that is used to render the vertical bar that indicates the insertion point.
Declaration
[NotImplemented]
public Brush CaretBrush { get; set; }
Property Value
Type | Description |
---|---|
Brush |
MaxLength
Gets or sets the maximum length for passwords to be handled by this PasswordBox.
Declaration
public int MaxLength { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | An integer that specifies the maximum number of characters for passwords to be handled by this PasswordBox. A value of zero (0) means no limit. The default is 0 (no length limit). |
Password
Gets or sets the password currently held by the PasswordBox.
Declaration
public string Password { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the password currently held by the PasswordBox.The default value is System.String.Empty. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The property is set to a null value. |
PasswordChar
Character to display instead of the actual password.
Declaration
public char PasswordChar { get; set; }
Property Value
Type | Description |
---|---|
System.Char |
SelectionBackground
Gets or sets the brush used to render the background for the selected text.
Declaration
[NotImplemented]
public Brush SelectionBackground { get; set; }
Property Value
Type | Description |
---|---|
Brush |
SelectionForeground
Gets or sets the brush used for the selected text in the PasswordBox.
Declaration
[NotImplemented]
public Brush SelectionForeground { get; set; }
Property Value
Type | Description |
---|---|
Brush |
Methods
| Improve this Doc View SourceMeasureOverride(Size)
Declaration
protected override Size MeasureOverride(Size availableSize)
Parameters
Type | Name | Description |
---|---|---|
Size | availableSize |
Returns
Type | Description |
---|---|
Size |
Overrides
| Improve this Doc View SourceOnApplyTemplate()
Builds the visual tree for the PasswordBox control when a new template is applied.
Declaration
public override void OnApplyTemplate()
Overrides
| Improve this Doc View SourceOnPasswordChanged(RoutedEventArgs)
Raises the PasswordChanged event
Declaration
protected void OnPasswordChanged(RoutedEventArgs eventArgs)
Parameters
Type | Name | Description |
---|---|---|
RoutedEventArgs | eventArgs |
SelectAll()
Selects all the character in the PasswordBox.
Declaration
public void SelectAll()
Events
| Improve this Doc View SourcePasswordChanged
Occurs when the value of the Password property changes.
Declaration
public event RoutedEventHandler PasswordChanged
Event Type
Type | Description |
---|---|
RoutedEventHandler |