private void FavoriteClick(object sender, EventArgs e) { ProgressBar.IsIndeterminate = true; ProgressBar.Visibility = Visibility.Visible; var twitter = new TwitterHelper(); twitter.FavoriteCompletedEvent += (sender2, e2) => { ProgressBar.IsIndeterminate = false; ProgressBar.Visibility = Visibility.Collapsed; MessageBox.Show("Item added to favorites"); }; twitter.ErrorEvent += (sender2, e2) => { ProgressBar.IsIndeterminate = false; ProgressBar.Visibility = Visibility.Collapsed; }; twitter.FavoriteItem(_detailItem.Id); }