async void load() { List <Folder> myFolder = await ContentServ.GetFavFolders(); foreach (var item in myFolder) { cb_folder.Items.Add(item); } cb_folder.SelectedIndex = 0; }
async void load() { cb_folder.Items.Clear(); List <Folder> myFolder = await ContentServ.GetFavFolders(); foreach (var item in myFolder) { cb_folder.Items.Add(item); } try { if (string.IsNullOrEmpty(name)) { cb_folder.SelectedIndex = 0; } else { cb_folder.SelectedIndex = myFolder.FindIndex(o => o.Name == name); } } catch { cb_folder.SelectedIndex = -1; } }
async void load() { list.ItemsSource = await ContentServ.GetFavFolders(); }
async Task load() { try { if (!isLoaded) { if (SettingHelper.GetValue("_accesskey").ToString().Length > 2) { string url = "http://account.bilibili.com/api/myinfo?access_key=" + ApiHelper.accesskey + "&appkey=" + ApiHelper.appkey + "&platform=wp&type=json"; url += ApiHelper.GetSign(url); JsonObject json = await BaseService.GetJson(url); if (json.ContainsKey("face")) { Face.Source = new BitmapImage { UriSource = new Uri(StringDeal.delQuotationmarks((json["face"].ToString()))) } } ; if (json.ContainsKey("coins")) { coins.Text = "硬币:" + json["coins"].ToString(); } if (json.ContainsKey("sign")) { sign.Text = StringDeal.delQuotationmarks(json["sign"].ToString()); } if (json.ContainsKey("uname")) { userName.Text = StringDeal.delQuotationmarks(json["uname"].ToString()); } if (json.ContainsKey("level_info")) { JsonObject json2 = JsonObject.Parse(json["level_info"].ToString()); if (json2.ContainsKey("next_exp")) { exp_total.Text = json2["next_exp"].ToString(); bar.Maximum = Convert.ToInt32(json2["next_exp"].ToString()); } if (json2.ContainsKey("current_exp")) { exp_current.Text = json2["current_exp"].ToString(); bar.Value = Convert.ToInt32(json2["current_exp"].ToString()); } if (json2.ContainsKey("current_level")) { level.Source = new BitmapImage { UriSource = new Uri("ms-appx:///Assets//Others//lv" + json2["current_level"].ToString() + ".png", UriKind.Absolute) }; } string url2 = "http://space.bilibili.com/ajax/settings/getSettings?mid=" + UserHelper.Mid; JsonObject json_toutu = await BaseService.GetJson(url2); if (json_toutu.ContainsKey("data")) { json_toutu = json_toutu["data"].GetObject(); if (json_toutu.ContainsKey("toutu")) { json_toutu = json_toutu["toutu"].GetObject(); if (json_toutu.ContainsKey("l_img")) { tl = "http://i0.hdslb.com/" + json_toutu["l_img"].GetString(); } if (json_toutu.ContainsKey("s_img")) { ts = "http://i0.hdslb.com/" + json_toutu["s_img"].GetString(); } } } UpDateHeader(); int pagesize = 20; if (SettingHelper.DeviceType == DeviceType.Mobile) { pagesize = 3; width.Width = ActualWidth / 3 - 8; } myFolder = await ContentServ.GetFavFolders(); folderlist.ItemsSource = myFolder; Site_Concern concern = await UserRelated.GetConcernBangumiAsync("", 1, true, pagesize); if (concern != null) { concern_count.Text = concern.Count; conlist.ItemsSource = concern.Result; } isLoaded = true; } } } } catch (Exception) { } }
async void load() { try { if (SettingHelper.GetValue("_accesskey").ToString().Length > 2) { string url = "http://api.bilibili.com/myinfo?appkey=" + ApiHelper.appkey + "&access_key=" + ApiHelper.accesskey; url += ApiHelper.GetSign(url); JsonObject json = await BaseService.GetJson(url); if (json.ContainsKey("face")) { Face.Source = new BitmapImage { UriSource = new Uri(StringDeal.delQuotationmarks((json["face"].ToString()))) } } ; if (json.ContainsKey("coins")) { coins.Text += json["coins"].ToString(); } if (json.ContainsKey("sign")) { sign.Text = StringDeal.delQuotationmarks(json["sign"].ToString()); } if (json.ContainsKey("uname")) { userName.Text = StringDeal.delQuotationmarks(json["uname"].ToString()); } if (json.ContainsKey("level_info")) { JsonObject json2 = JsonObject.Parse(json["level_info"].ToString()); if (json2.ContainsKey("next_exp")) { exp_total.Text = json2["next_exp"].ToString(); bar.Maximum = Convert.ToInt32(json2["next_exp"].ToString()); } if (json2.ContainsKey("current_exp")) { exp_current.Text = json2["current_exp"].ToString(); bar.Value = Convert.ToInt32(json2["current_exp"].ToString()); } if (json2.ContainsKey("current_level")) { level.Source = new BitmapImage { UriSource = new Uri("ms-appx:///Assets//Others//lv" + json2["current_level"].ToString() + ".png", UriKind.Absolute) }; } } } myFolder = await ContentServ.GetFavFolders(); foreach (var item in await ContentServ.GetConAsync(1)) { conlist.Items.Add(item); } int count = 0; foreach (var item in myFolder) { count += int.Parse(item.Count); } if (count == 0) { fav.Content += "(暂无收藏)"; } } catch { } }