public void LoadAccounts() { if (AccountViewModels == null) { AccountViewModels = new ObservableCollection <AccountViewModel>(); } else { AccountViewModels.Clear(); } List <Account> accounts = AccountManager.Instance.Accounts; foreach (Account acc in accounts) { AccountViewModels.Add(new AccountViewModel(acc)); } }
public void LoadAccounts() { if (AccountViewModels == null) { AccountViewModels = new ObservableCollection <AccountViewModel>(); } else { AccountViewModels.Clear(); } List <Account> accounts = AccountManager.Instance.Accounts; foreach (Account acc in accounts) { AccountViewModels.Add(new AccountViewModel(acc)); } // Select the first mailbox of the first account by default. if (AccountViewModels.Count > 0 && AccountViewModels[0].MailboxViewModelTree.Count > 0) { AccountViewModels[0].MailboxViewModelTree[0].IsSelected = true; } }