public async Task newGetHotimageAsync() { // getapistring = new GetAPIstring(); switch (HomePage_Pivot.SelectedIndex) { case 0: var Hotjsonvalue = await getapistring.GetWebString(hotapiuri); var savejsonreturn = gethotjson.SaveJson(Hotjsonvalue); Homehoturl = savejsonreturn.First().sample_url; BitmapImage bit = new BitmapImage(new Uri(Homehoturl)); HomeHot.Source = bit; Topprogress.Visibility = Visibility.Collapsed; //江+1s热榜瀑布流传递给热榜页面 MTHub.Hotitemvalue = savejsonreturn; break; case 1: var Hotjsonvalue2 = await getapistring.GetWebString($"{apiurisave.KonachanHotHost}"); var savejsonreturn2 = gethotjson.SaveJson_konachan(Hotjsonvalue2); string hoturi = savejsonreturn2.First().sample_url; BitmapImage bit2 = new BitmapImage(new Uri(hoturi)); HomeHot2.Source = bit2; Topprogress.Visibility = Visibility.Collapsed; //江+1s热榜瀑布流传递给热榜页面 MTHub.Hotitemvalue_Konachan = savejsonreturn2; break; } }
private void Setjsonstring(string jsontext, int sourceindex) { //使用Savejson方法将json数据反序列化到存储 // getjson.NoH(); // Mygridview.ItemsSource = source; switch (sourceindex) { case 0: var source = getjson.SaveJson(jsontext); Mygridview.ItemsSource = source; progressrin.IsActive = false; break; case 1: var source2 = getjson.SaveJson_konachan(jsontext); Mygridview2.ItemsSource = source2; break; //case 2: // Mygridview3.ItemsSource = source; // break; //case 3: // Mygridview4.ItemsSource = source; // break; } }
private async void SetjsonstringAsync(string jsontext, int item) { try { switch (item) { case 0: Topprogress.Visibility = Visibility.Visible; var source = getjson.SaveJson(jsontext); Pictureada.ItemsSource = source; await newGetHotimageAsync(); break; case 1: Topprogress2.Visibility = Visibility.Visible; var soure_konacha = getjson_konachan.SaveJson_konachan(jsontext); Pictureada2.ItemsSource = soure_konacha; await newGetHotimageAsync(); Topprogress2.Visibility = Visibility.Collapsed; break; } } catch (Exception ex) { await new MessageDialog(ex.ToString()).ShowAsync(); } }