コード例 #1
0
        private void HandleNewAccountAddedEvent(Account newAccount)
        {
            if (newAccount == null)
            {
                throw new ArgumentNullException("newAccount");
            }

            AccountViewModel newAccountViewModel = new AccountViewModel(newAccount);
            Application.Current.Dispatcher.Invoke(() =>
            {
                AccountViewModels.Add(newAccountViewModel);
            });
        }
コード例 #2
0
 private void BeginDeleteAccount(AccountViewModel accountVm)
 {
     if (accountVm != null)
     {
         if (CurrentMailbox.AccountName == accountVm.Account.AccountName)
         {
             SelectedTreeViewItem = null;
         }
         Task.Run(() => { AccountManager.Instance.DeleteAccount(accountVm.Account); });
     }
 }