private async void GetSeachResult(string Seach_text) { progressrin.IsActive = true; NoSeachContent_textblock.Visibility = Visibility.Collapsed; string jsontext = await getapistring.GetWebString(CS.apiset.apiurisave.YandeHost + "post.json?tags=" + Seach_text); TagModes = getjson.SaveJson(jsontext); // getjson.NoH(); //if( getjson.list.Count == 40) //{ //} Mygridview.ItemsSource = TagModes; if (TagModes.Count == 0) { progressrin.IsActive = false; NoSeachContent_textblock.Text = "当前关键字未搜索到内容,请更换关键字QAQ"; NoSeachContent_textblock.Visibility = Visibility.Visible; } else { progressrin.IsActive = false; NoSeachContent_textblock.Visibility = Visibility.Collapsed; } }
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(); } }
private async Task getStar(string urihost, string name) { if (name != null & name != "") { //tags=vote%3A3%3Aluojiwei+order%3Avote string uri = $"{urihost}post.json?tags=vote%3A3%3A{name}+order%3Avote"; string response = await getresponse.GetWebString(uri); Source_Yande = getjson.SaveJson(response); Mygridview.ItemsSource = Source_Yande; } else { await new MessageDialog("您没有登陆").ShowAsync(); } }