void backgroundWorkerRecentTweets_ProgressChanged(object sender, ProgressChangedEventArgs e) { TwitterItem item = (TwitterItem)e.UserState; if (item != null) { if (RecentTweets.Where(i => i.Id == item.Id).Count() == 0) { RecentTweets.Add(item); } } }
public void UpdateRecentTweets() { RecentTweets.Clear(); if (LastTweet != null) { RecentTweets.Add(LastTweet); } if (!backgroundWorkerRecentTweets.IsBusy) { backgroundWorkerRecentTweets.RunWorkerAsync(); } else { backgroundWorkerRecentTweets.CancelAsync(); } }