private async void MarkdownTextBlock_ImageResolving(object sender, ImageResolvingEventArgs e) { var deferral = e.GetDeferral(); e.Image = await ImageCacheHelper.GetImage(ImageType.OriginImage, e.Url); e.Handled = true; deferral.Complete(); }
async void GetPic(string u) { if (!string.IsNullOrEmpty(u)) { UserAvatar = await ImageCacheHelper.GetImage(ImageType.BigAvatar, u); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(UserAvatar))); } }
private async void GetPic() { if (!string.IsNullOrEmpty(userSmallAvatarUrl)) { UserSmallAvatar = await ImageCacheHelper.GetImage(ImageType.SmallAvatar, userSmallAvatarUrl); } if (!string.IsNullOrEmpty(extraPicUrl)) { Extra_pic = await ImageCacheHelper.GetImage(ImageType.Icon, extraPicUrl); } }
private async void GetPic() { if (ShowPic) { Pic = new ImageData { Pic = await ImageCacheHelper.GetImage(ImageType.SmallImage, PicUrl), url = PicUrl } } ; if (!string.IsNullOrEmpty(userSmallAvatarUrl)) { UserSmallAvatar = await ImageCacheHelper.GetImage(ImageType.SmallAvatar, userSmallAvatarUrl); } }
async void GetPic(JObject token) { if (ShowPicArr || IsCoolPictuers) { PicArr = new ObservableCollection <ImageData>(); foreach (var item in token["picArr"] as JArray) { PicArr.Add(new ImageData { Pic = await ImageCacheHelper.GetImage(ImageType.SmallImage, item.ToString()), url = item.ToString() }); } } if (token.TryGetValue("pic", out JToken value1) && !string.IsNullOrEmpty(value1.ToString())) { Pic = await ImageCacheHelper.GetImage(ImageType.SmallImage, value1.ToString()); } }
private async void GetPic() { if (ShowDyh && !string.IsNullOrEmpty(dyhlogoUrl)) { Dyhlogo = await ImageCacheHelper.GetImage(ImageType.Icon, dyhlogoUrl); } if (ShowRelationRows) { foreach (var item in RelationRows) { if (!string.IsNullOrEmpty(item.logoUrl)) { item.Logo = await ImageCacheHelper.GetImage(ImageType.Icon, item.logoUrl); } } } }
private async void GetPic(JObject token) { if (token.TryGetValue("pic", out JToken v5)) { HasPic = !string.IsNullOrEmpty(v5.ToString()); if (HasPic) { Pic = await ImageCacheHelper.GetImage(ImageType.OriginImage, v5.ToString()); } } else if (token.TryGetValue("logo", out JToken v6)) { HasPic = !string.IsNullOrEmpty(v6.ToString()); if (HasPic) { Pic = await ImageCacheHelper.GetImage(ImageType.Icon, v6.ToString()); } } }
private async void GetPic() { if (Has_message_cover) { Message_cover = await ImageCacheHelper.GetImage(ImageType.SmallImage, Message_cover_url); } if (ShowTtitle) { Tpic = await ImageCacheHelper.GetImage(ImageType.Icon, tpicUrl); } if (ShowRelationRows) { foreach (var item in RelationRows) { if (!string.IsNullOrEmpty(item.logoUrl)) { item.Logo = await ImageCacheHelper.GetImage(ImageType.Icon, item.logoUrl); } } } }
private async void UserControl_Loaded(object sender, RoutedEventArgs e) { string uid = SettingsHelper.Get <string>("Uid"); if (string.IsNullOrEmpty(uid)) { LoginButton.Visibility = Visibility.Visible; LogoutButton.Visibility = UserDetailGrid.Visibility = Visibility.Collapsed; } else { LoginButton.Visibility = Visibility.Collapsed; UserDetailGrid.Visibility = Visibility.Visible; var o = (JObject)await DataHelper.GetData(DataUriType.GetUserProfile, uid); UIHelper.MainPageUserAvatar = userAvatar = await ImageCacheHelper.GetImage(ImageType.BigAvatar, o.Value <string>("userAvatar")); userName = o.Value <string>("username"); feedNum = o.Value <int>("feed"); followNum = o.Value <int>("follow"); fansNum = o.Value <int>("fans"); levelNum = o.Value <int>("level"); nextLevelExperience = o.Value <int>("next_level_experience"); nextLevelPercentage = o.Value <double>("next_level_percentage"); levelTodayMessage = o.Value <string>("level_today_message"); nextLevelNowExperience = $"{nextLevelPercentage / 100 * nextLevelExperience:F0}/{nextLevelExperience}"; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(userAvatar))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(userName))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(fansNum))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(feedNum))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(followNum))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(levelNum))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(nextLevelPercentage))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(levelTodayMessage))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(nextLevelNowExperience))); } }
public async Task <ImageSource> GetImage() => await ImageCacheHelper.GetImage(Type, Url, true);
private async void Button_Click_2(object sender, RoutedEventArgs e) { pic.Source = await ImageCacheHelper.GetImage(ImageType.OriginImage, picUri.Text, true); }
async void GetPic(JObject token) => UserAvatar = await ImageCacheHelper.GetImage(ImageType.SmallAvatar, token.Value <string>("userSmallAvatar"));
async void GetPic(JObject token) => Logo = await ImageCacheHelper.GetImage(ImageType.Icon, token.Value <string>("logo"));