private async void Button_Click(object sender, RoutedEventArgs e) { LbAccounts.Items.Clear(); LbStores.Items.Clear(); TxtLog.Clear(); TxtUpdates.Clear(); (ConcurrentBag <DlQuestion> allQuestions, ConcurrentBag <DlReview> allReviews) = await ReloadAsync(Name, tbAccount.Text).ConfigureAwait(false); await Dispatcher.InvokeAsync(() => { DlQuestions questions = (DlQuestions)Resources["Questions"]; questions.Clear(); foreach (DlQuestion x in allQuestions) { questions.Add(x); } DlReviews reviews = (DlReviews)Resources["Reviews"]; reviews.Clear(); foreach (DlReview x in allReviews) { reviews.Add(x); } }); }
private async Task AddUserNotificationAsync(string output) { await Dispatcher.InvokeAsync(() => { TxtUpdates.AppendText(output + Environment.NewLine); TxtUpdates.ScrollToEnd(); }); Console.WriteLine(output); }