我有我的JSON請求抓取URI,甚至可以把項目綁定,但不是圖像。從JSON獲取圖像URL到列表框綁定
XAML:
<Image delay:LowProfileImageLoader.UriSource="{Binding ImageUrl}" Width="120" Height="120" />
<TextBlock Text="{Binding DisplayName}" FontSize="30" TextWrapping="Wrap" TextTrimming="WordEllipsis" />
現在,一旦我得到的飼料我運行它像這樣:
using (var stream = new MemoryStream(Encoding.Unicode.GetBytes(e.Result)))
{
DataContractJsonSerializer dataContractJsonSerializer = new DataContractJsonSerializer(typeof(ProviderChannels.RootObject));
var providerResult = (ProviderChannels.RootObject)dataContractJsonSerializer.ReadObject(stream);
if (providerResult.ServiceDetailsResult != null)
{
ProviderChannels.ItemsSource = providerResult.ServiceResult.Lineup.Channels;
}
的問題是,我不能讓圖像採取那是的ImageUrl從:
public class Channeli
{
public string DisplayName { get; set; }
public List<object> ChannelImages { get; set; }
}
進料/ ChannelImages執行此:
"ChannelImages": [
{
"ImageUrl": "http://the-url-generated.com/file.png",
"ImageUseType": null,
}
ChannelImages報告一個ImageUrl和一堆其他數據,但我需要嚴格的ImageUrl,但似乎即使在XAML,如果我把ImageUrl它不會工作,但我如何使用ChannelImages獲取ImageUrl?
感謝您的幫助!
在哪裏存儲的圖像? –
圖像存儲在JSON供稿鏈接的任何位置(例如,ImageUri可能有圖像URL轉到Google圖像)。 – user1239234