private bool HasAccountStored() { //TODO: should we get this from our local repo? Not for a sample, but yes for real apps var taskAccounts = WebAccountManager.FindAllProviderWebAccountsAsync().AsTask <IReadOnlyList <WebAccount> >(); taskAccounts.Wait(); var accounts = taskAccounts.Result; return(accounts.Count > 0); }
private async Task AddWebAccountToPane(AccountsSettingsPaneCommandsRequestedEventArgs e) { var taskAccounts = WebAccountManager.FindAllProviderWebAccountsAsync().AsTask <IReadOnlyList <WebAccount> >(); taskAccounts.Wait(); var accounts = taskAccounts.Result; foreach (WebAccount account in accounts) { WebAccountCommand command = new WebAccountCommand(account, WebAccountCommandInvoked, SupportedWebAccountActions.Remove); e.WebAccountCommands.Add(command); } }
private async Task PopulateAccounts( ) { var accounts = await WebAccountManager.FindAllProviderWebAccountsAsync(); AccountsComboBox.ItemsSource = accounts; if (accounts.Count <= 0) { UseAccount.IsEnabled = false; UseAccount.IsChecked = false; } else { UseAccount.IsEnabled = true; } foreach (var acct in accounts) { DebugPrint($"Acct:{acct.Id},User{acct.UserName}"); } }