[英]How to get image article from rss feed windows 10
I want to add article's image to listview from rss feed in windows 10 我想将文章的图像从Windows 10中的rss feed添加到listview
I try this article to add rss feed : https://code.msdn.microsoft.com/windowsapps/How-to-perform-RSS-Reader-4803093b 我尝试这篇文章添加rss提要: https : //code.msdn.microsoft.com/windowsapps/How-to-perform-RSS-Reader-4803093b
But I can't add article's image in listview 但是我不能在列表视图中添加文章的图像
For adding image to you listview items you need to define the Listview DataTemplate to something like this : 要将图像添加到listview项目中,您需要将Listview DataTemplate定义为如下所示:
<ListView x:Name="MyList">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Image Source={Binding img} Height="100"/>
<TextBlock Text="{Binding text}"/>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Then you can provide the image source and text to each item by creating a list of items from your RSS Feed and then assigning your ListView
item source to this list. 然后,可以通过从RSS Feed中创建项目列表,然后将ListView
项目源分配给此列表,来为每个项目提供图像源和文本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.