Class PasswordBoxHelper
Extension for the PasswordBox
which allows to bind its Password
property.
Original source code (Creative Commons License):
http://blog.functionalfun.net/2008/06/wpf-passwordbox-and-data-binding.html
Commented and minor naming modifications.
Inheritance
System.Object
PasswordBoxHelper
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Phoenix.Controls
Assembly: Phoenix.Controls.dll
Syntax
public static class PasswordBoxHelper
Fields
View SourceAttach
DependencyProperty
which allows to indicate if the Password
property should be bound or not.
Declaration
public static readonly DependencyProperty Attach
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty |
BoundPassword
DependencyProperty
for the Password
string.
Declaration
public static readonly DependencyProperty BoundPassword
Field Value
Type | Description |
---|---|
System.Windows.DependencyProperty |
Methods
View SourceGetAttach(DependencyObject)
Gets the value currently assigned to Attach
.
Declaration
public static bool GetAttach(DependencyObject target)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | target | Object to get the value from. |
Returns
Type | Description |
---|---|
System.Boolean | Value assigned to |
GetBoundPassword(DependencyObject)
Gets the value currently assigned to BoundPassword
.
Declaration
public static string GetBoundPassword(DependencyObject target)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | target | Object to get the value from. |
Returns
Type | Description |
---|---|
System.String | Value assigned to |
SetAttach(DependencyObject, Boolean)
Sets the value of Attach
.
Declaration
public static void SetAttach(DependencyObject target, bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | target | Object to set the value for. |
System.Boolean | value | Value to set. |
SetBoundPassword(DependencyObject, String)
Sets the value of BoundPassword
.
Declaration
public static void SetBoundPassword(DependencyObject target, string value)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | target | Object to set the value for. |
System.String | value | Value to set. |