void cmb_Dismissed(object sender, DismissedEventArgs e) { switch (e.Result) { case CustomMessageBoxResult.LeftButton: { if (string.IsNullOrEmpty(_currentAccountData.Login.Text)) return; if (string.IsNullOrEmpty(_currentAccountData.Name.Text)) return; if (string.IsNullOrEmpty(_currentAccountData.Password.Text)) return; if (_currentAccountData.IsEdit) { Account editAccount = PassHoslder.SelectedItem as Account; editAccount.Name = _currentAccountData.Name.Text; editAccount.Login = _currentAccountData.Login.Text; editAccount.Password = _currentAccountData.Password.Text; } else { Account a = new Account(); a.Login = _currentAccountData.Login.Text; a.Name = _currentAccountData.Name.Text; a.Password = _currentAccountData.Password.Text; _accounts.Add(a); } SaveAccounts(); HandleOneDriveBehaviour(); } break; case CustomMessageBoxResult.RightButton: break; default: break; } PassHoslder.SelectedItem = null; _dialogIsShow = false; }
private void EditAccount(Account account) { _currentAccountData = new AddAccount(); _currentAccountData.Name.Text = account.Name; _currentAccountData.Login.Text = account.Login; _currentAccountData.Password.Text = account.Password; _currentAccountData.IsEdit = true; ShowAddEditAccountDialog(); }