protected override void OnNavigatedFrom(NavigationEventArgs e) { switch (listContent) { case ListContent.Recommend: Data.OverAll.RecommendList.PauseLoading(); break; case ListContent.Bookmark: Data.OverAll.BookmarkList.PauseLoading(); break; case ListContent.Following: Data.OverAll.FollowingList.PauseLoading(); break; case ListContent.Ranking: Data.OverAll.RankingList.PauseLoading(); break; case ListContent.SearchResult: Data.OverAll.SearchResultList.PauseLoading(); break; } base.OnNavigatedFrom(e); if (!_backflag) { Data.Backstack.Default.Push(typeof(WaterfallPage), (listContent, clickedIndex)); TheMainPage?.UpdateNavButtonState(); } ItemsSource = null; }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.Parameter is SearchParam) { param = (SearchParam)e.Parameter; } ItemsSource = new SearchResultIllustsCollection(param.Word, param.SearchTarget, param.Sort, param.Duration); WaterfallListView.ItemsSource = ItemsSource; }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.Parameter is ListContent) { listContent = (ListContent)e.Parameter; } else if (e.Parameter is ValueTuple <ListContent, int?> tuple) { (listContent, clicked) = tuple; } switch (listContent) { case ListContent.Recommend: WaterfallListView.ItemsSource = Data.OverAll.RecommendList; Data.OverAll.RecommendList.ResumeLoading(); break; case ListContent.Bookmark: WaterfallListView.ItemsSource = Data.OverAll.BookmarkList; Data.OverAll.BookmarkList.ResumeLoading(); break; case ListContent.Following: WaterfallListView.ItemsSource = Data.OverAll.FollowingList; Data.OverAll.FollowingList.ResumeLoading(); break; case ListContent.Ranking: WaterfallListView.ItemsSource = Data.OverAll.RankingList; Data.OverAll.RankingList.ResumeLoading(); break; case ListContent.SearchResult: ItemsSource = Data.OverAll.SearchResultList; Data.OverAll.SearchResultList.ResumeLoading(); WaterfallListView.ItemsSource = ItemsSource; break; } }
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { base.OnNavigatingFrom(e); ItemsSource?.StopLoading(); ItemsSource = null; }