protected async override void OnNavigatedTo(NavigationEventArgs e) { var json = e.Parameter as string; var paihangdata = Class.data.DataContractJsonDeSerialize <YueKuPage.ViewMode.PaiHang>(json); title.Text = paihangdata.rankname; listmanager = new SongDataList(paihangdata.rankid); SongLoadProgress.IsActive = true; await listmanager.LoadPage(); SongListView.ItemsSource = listmanager.list; SongListView.SelectionMode = ListViewSelectionMode.Single; SongListView.SelectionChanged += SongListView_SelectionChanged; SongLoadProgress.IsActive = false; }
private void ScrollViewer_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e) { var sv_SP = sender as ScrollViewer; if (sv_SP.VerticalOffset == sv_SP.ScrollableHeight) { lock (o) { if (!SongLoadProgress.IsActive) { SongLoadProgress.IsActive = true; Task.Factory.StartNew(async() => { await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async() => { await listmanager.LoadPage(); SongLoadProgress.IsActive = false; }); }); } } } }