private void LeftListViewv_RefreshRequested(object sender, RefreshRequestedEventArgs e) { if (LeftWrap.DataContext == null) { return; } var vmType = LeftWrap.DataContext.GetType(); if (vmType.Equals(typeof(DefaultThreadListViewViewModel))) { var vm = LeftWrap.DataContext as DefaultThreadListViewViewModel; vm.LoadPrevPageData(); } else if (vmType.Equals(typeof(MyThreadsThreadListViewViewModel))) { var vm = LeftWrap.DataContext as MyThreadsThreadListViewViewModel; vm.LoadPrevPageData(); } else if (vmType.Equals(typeof(MyPostsThreadListViewViewModel))) { var vm = LeftWrap.DataContext as MyPostsThreadListViewViewModel; vm.LoadPrevPageData(); } else if (vmType.Equals(typeof(MyFavoritesThreadListViewViewModel))) { var vm = LeftWrap.DataContext as MyFavoritesThreadListViewViewModel; vm.LoadPrevPageData(); } if (SpinnerStoryboard.GetCurrentState() != ClockState.Stopped) { SpinnerStoryboard.Stop(); } }
private async void listView_RefreshRequested(object sender, RefreshableListView.RefreshRequestedEventArgs e) { using (Deferral deferral = listView.AutoRefresh ? e.GetDeferral() : null) { await FetchAndInsertItemsAsync(_rand.Next(1, 5)); if (SpinnerStoryboard.GetCurrentState() != Windows.UI.Xaml.Media.Animation.ClockState.Stopped) { SpinnerStoryboard.Stop(); } } }
private void listView_PullProgressChanged(object sender, RefreshableListView.RefreshProgressEventArgs e) { if (e.IsRefreshable) { if (e.PullProgress == 1) { // Progress = 1.0 means that the refresh has been triggered. if (SpinnerStoryboard.GetCurrentState() == Windows.UI.Xaml.Media.Animation.ClockState.Stopped) { SpinnerStoryboard.Begin(); } } else if (SpinnerStoryboard.GetCurrentState() != Windows.UI.Xaml.Media.Animation.ClockState.Stopped) { SpinnerStoryboard.Stop(); } else { // Turn the indicator by an amount proportional to the pull progress. SpinnerTransform.Angle = e.PullProgress * 360; } } }
public static void StopSpinning() { SpinnerStoryboard.Stop(); SpinnerGrid.Visibility = Visibility.Collapsed; SpinnerActive = false; }