private async void PlayedRecord_Loaded(object sender, RoutedEventArgs e) { ProgressBar_Loading.Visibility = Visibility.Visible; RecordData recordData = await Task.Run(() => RecordDataService.GetRecordData(ConfigService.Uid, 1)); if (recordData.WeekData != null) { ListBox_Week.ItemsSource = recordData.WeekData; } else { NotifyPopup notifyPopup = new NotifyPopup("获取最近一周记录失败"); notifyPopup.Show(); } ProgressBar_Loading.Visibility = Visibility.Collapsed; }
private async void Pivot_SelectionChanged(object sender, SelectionChangedEventArgs e) { PivotItem pivotItem = (PivotItem)((Pivot)sender).SelectedItem; if (pivotItem.Tag.ToString() == "1") { if (ListBox_All.ItemsSource == null) { ProgressBar_Loading.Visibility = Visibility.Visible; RecordData recordData = await Task.Run(() => RecordDataService.GetRecordData(ConfigService.Uid, 0)); if (recordData.AllData != null) { ListBox_All.ItemsSource = recordData.AllData; } else { NotifyPopup notifyPopup = new NotifyPopup("获取全部记录失败"); notifyPopup.Show(); } ProgressBar_Loading.Visibility = Visibility.Collapsed; } } }