TextBox Password Char

This answer may provide you with what you need.


I made my way around this particular problem by creating two Properties for the Password content and binding both of them to the same Model value. One of them (the visible UI Element) binds to Password. The Get on this property of course then returns an array of characters for display. The functions that must use the password text can use the PlainPassword Property.

Adding "UpdateSourceTrigger=PropertyChanged" to the Binding for the textbox causes the characters to appear in the text box as they are typed.

  public string Password
  {
     set
     {
        Model.Password = value;
        OnPropertyChanged("Password");
     }
     get 
     {
        return new String('●', Model.Password.Length); 
     }
  }

  public string PlainPassword
  {
     set
     {
        Model.Password = value;
        OnPropertyChanged("Password");
     }
     get { return Model.Password; }
  }