// private void Refesh_Click(object sender, RoutedEventArgs e) // { // loadItems(); // } private async void mainpivot_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (WebStatusHelper.IsOnline()) { try { switch (mainpivot.SelectedIndex) { case 0: { if (!isTopicLoaded) { // string url = "http://api.bilibili.com/x/web-show/res/loc?jsonp=jsonp&pf=0&id=23"; // List<Models.Topic> MyList = await ContentServ.GetTopicListAsync(url); // foreach (var item in MyList) // { // show_1.Source.Add(new Controls.RecommandShow.MySource { bmp = new BitmapImage { UriSource = new Uri(item.Pic) }, url = item.Url }); // } // show_1.show(); await comment.init(); header_Home.init(await ContentServ.GetHomeBanners()); header_Home.navi += Header_navi; isTopicLoaded = true; } } break; case 1: { if (!await addcomment(cursor)) { await addcomment(cursor); } header_bangumi.init(await ContentServ.GetBangumiBanners()); if (list_lastupdate.Items.Count == 0) { list_lastupdate.ItemsSource = await ContentServ.GetLastUpdateAsync(); } header_bangumi.navi += Header_navi; } break; case 2: { if (!isFriendsLoaded) { await loadpulls(1); isFriendsLoaded = true; } } break; case 3: { // 发现 if (list_hottags.Items.Count == 0) { list_hottags.ItemsSource = await ContentServ.GetHotSearchAsync(); } } break; } } catch (Exception err) { string a = err.Message; } } }