@@ -48,26 +48,27 @@ public class PromptingPasswordBox : Control {
4848 static PromptingPasswordBox ( ) {
4949 DefaultStyleKeyProperty . OverrideMetadata ( typeof ( PromptingPasswordBox ) , new FrameworkPropertyMetadata ( typeof ( PromptingPasswordBox ) ) ) ;
5050
51-
5251
52+
53+
5354 }
5455
56+
5557 public override void OnApplyTemplate ( ) {
5658 var PasswordBox = GetTemplateChild ( "UserInputBox" ) as PasswordBox ;
5759 PasswordBox . PasswordChanged += PasswordChanged ;
5860 }
5961
6062 private void PasswordChanged ( object sender , RoutedEventArgs e ) {
61- var password = ( ( PasswordBox ) sender ) . Password ;
62- Console . WriteLine ( password ) ;
63- this . FieldCompleted = ! String . IsNullOrEmpty ( password ) ;
63+ this . ActualPassword = ( ( PasswordBox ) sender ) . Password ;
64+ this . FieldCompleted = ! String . IsNullOrEmpty ( this . ActualPassword ) ;
6465 }
6566
6667 public static readonly DependencyProperty FieldCompletedProperty = DependencyProperty . Register ( "FieldCompleted" , typeof ( bool ) , typeof ( PromptingPasswordBox ) , new PropertyMetadata ( false ) ) ;
6768 public static readonly DependencyProperty PromptingTextProperty = DependencyProperty . Register ( "PromptingText" , typeof ( string ) , typeof ( PromptingPasswordBox ) , new PropertyMetadata ( "" ) ) ;
6869 public static readonly DependencyProperty FocusedUnderlineBrushProperty = DependencyProperty . Register ( "FocusedUnderlineBrush" , typeof ( Brush ) , typeof ( PromptingPasswordBox ) , new PropertyMetadata ( default ( Brush ) ) ) ;
6970 public static readonly DependencyProperty HoverUnderlineBrushProperty = DependencyProperty . Register ( "HoverUnderlineBrush" , typeof ( Brush ) , typeof ( PromptingPasswordBox ) , new PropertyMetadata ( default ( Brush ) ) ) ;
70- public static readonly DependencyProperty ActualPasswordProperty = DependencyProperty . Register ( "ActualPassword" , typeof ( SecureString ) , typeof ( PromptingPasswordBox ) , new PropertyMetadata ( default ( SecureString ) ) ) ;
71+ public static readonly DependencyProperty ActualPasswordProperty = DependencyProperty . Register ( "ActualPassword" , typeof ( string ) , typeof ( PromptingPasswordBox ) , new PropertyMetadata ( default ( SecureString ) ) ) ;
7172
7273 public bool FieldCompleted {
7374 get { return ( bool ) GetValue ( FieldCompletedProperty ) ; }
@@ -88,8 +89,8 @@ public Brush HoverUnderlineBrush {
8889 set { SetValue ( HoverUnderlineBrushProperty , value ) ; }
8990 }
9091
91- public Brush ActualPassword {
92- get { return ( Brush ) GetValue ( ActualPasswordProperty ) ; }
92+ public string ActualPassword {
93+ get { return ( string ) GetValue ( ActualPasswordProperty ) ; }
9394 set { SetValue ( ActualPasswordProperty , value ) ; }
9495 }
9596 }
0 commit comments