private void LikedPostViewLoaded(object sender, RoutedEventArgs e) { try { try { RefreshControl.RefreshRequested -= RefreshControlRefreshRequested; RefreshControl.Visualizer.RefreshStateChanged -= RefreshControlRefreshStateChanged; } catch { } RefreshControl.RefreshRequested += RefreshControlRefreshRequested; if (RefreshControl.Visualizer != null) { RefreshControl.Visualizer.RefreshStateChanged += RefreshControlRefreshStateChanged; } if (NavigationMode == NavigationMode.New) { GetType().RemovePageFromBackStack(); NavigationCacheMode = NavigationCacheMode.Enabled; CanLoadFirstPopUp = false; } if (!CanLoadFirstPopUp) { LikedPostVM.ResetCache(); LikedPostVM.RunLoadMore(true); ScrollableLikedPostUc.SetData(LikedPostVM, -1); CanLoadFirstPopUp = true; } } catch { } }
private void RefreshControlRefreshRequested(Microsoft.UI.Xaml.Controls.RefreshContainer sender, Microsoft.UI.Xaml.Controls.RefreshRequestedEventArgs args) { using (var RefreshCompletionDeferral = args.GetDeferral()) LikedPostVM.RunLoadMore(true); }