So if I understand you correctly you want to download the feed and then just have the items in an List, array or similair instead of in the listbox? Then you can simpy add the line:
var feedItems = new List<SyndicationItem>(feed.Items);
I also get the feeling you want it all in one function instead, then you can do it this way using Tasks:
public static Task<List<SyndicationItem>> Execute(string link)
{
WebClient wc = new WebClient();
TaskCompletionSource<List<SyndicationItem>> tcs = new TaskCompletionSource<List<SyndicationItem>>();
wc.DownloadStringCompleted += (s, e) =>
{
if (e.Error == null)
{
StringReader stringReader = new StringReader(e.Result);
XmlReader xmlReader = XmlReader.Create(stringReader);
SyndicationFeed feed = SyndicationFeed.Load(xmlReader);
tcs.SetResult(new List<SyndicationItem>(feed.Items));
}
else
{
tcs.SetResult(new List<SyndicationItem>());
}
};
wc.DownloadStringAsync(new Uri(link, UriKind.Absolute));
return tcs.Task;
}
And then your event handler for the button would be:
private async void loadFeedButton_Click(object sender, System.Windows.RoutedEventArgs e)
{
var rssItems = await Execute("http://windowsteamblog.com/windows_phone/b/windowsphone/rss.aspx");
MessageBox.Show("Number of RSS items: " + rssItems.Count);
}
Note the async and await keywords, you can read more about those in the documentation.