Пример #1
0
        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();
                        }
                    }
                };
            }
        }
Пример #2
0
 public void ClearPasswordBox()
 {
     SecredPasswordInput.Clear();
 }