public Login() { InitializeComponent(); var rememberedUsername = Settings.Default.rememberedUsername; if (!string.IsNullOrEmpty(rememberedUsername)) { SecredPasswordInput.Password = "******"; } else { ClearPasswordBox(); } if (DataContext is LoginVM) { var loginVM = DataContext as LoginVM; loginVM.PropertyChanged += (s, e) => { if (e.PropertyName.Equals("Password")) { if (loginVM.Password.Length == 0) { SecredPasswordInput.Clear(); } } }; } }
public void ClearPasswordBox() { SecredPasswordInput.Clear(); }