WindowsPhone"ListBox"ItemsSource我有一个列表,想把下载的提要分发给她。还想说我使用的代码与我在另一个应用程序中使用的代码相同,但它给出的错误和这个一样少。另一个完美。我将发布一些作为来源。因为如果你不能停留太久。privatevoidcarregaListas(){WebClientwebClient=newWebClient();webClient.DownloadStringCompleted+=newDownloadStringCompletedEventHandler(webClient_DownloadStringCompleted);webClient.DownloadStringAsync(newSystem.Uri("http://www.news-medical.net/syndication.axd?format=rss"));}privatevoidwebClient_DownloadStringCompleted(objectsender,DownloadStringCompletedEventArgse){if(e.Error!=null){Deployment.Current.Dispatcher.BeginInvoke(()=>{stkLife.Visibility=Visibility.Visible;stbOfLife.Begin();});}else{//将提要保存到State属性中,以防应用程序被逻辑删除。//gridProgressBar.Visibility=Visibility.Collapsed;this.State["feed"]=e.Result;UpdateFeedList(e.Result);}}privatevoidUpdateFeedList(stringfeedXML){StringReaderstringReader=newStringReader(feedXML);XmlReaderxmlReader=XmlReader.Create(stringReader);SyndicationFeed提要=SyndicationFeed.Load(xmlReader);部署.Current.Dispatcher.BeginInvoke(()=>{feedListBox.ItemsSource=feed.Items;});错误:“TheitemscollectionmustbeemptybeforeusingItemsSource”XAML代码:我用过这个例子:http://code.msdn.microsoft.com/wpapps/RSS-Reader-Sample-1702775f以上是全部内容C#学习教程分享:WindowsPhone"ListBox"ItemsSource,如果对你有用,需要进一步了解C#学习教程,希望大家多多关注~本文收集自网络,并非原创代表一个立场。如涉及侵权,请点击右侧联系管理员删除。如需转载请注明出处:
