private void MenuItem_Click(object sender, RoutedEventArgs e) { try { // Dirty hack.. . Smartfiction.ViewModel.ContentItem item = (Smartfiction.ViewModel.ContentItem)((MenuItem)sender).DataContext; App.ViewModel.AddFavorite(item.Title, item.ItemPublishDate, item.Link, item.ItemDetails); } catch (Exception ex) { Story item = (Story)((MenuItem)sender).DataContext; App.ViewModel.AddFavorite(item.Title, item.DatePublished, item.Link, item.Details); } }
private void MenuItem_Click(object sender, RoutedEventArgs e) { Smartfiction.ViewModel.ContentItem item = (Smartfiction.ViewModel.ContentItem)((MenuItem)sender).DataContext; App.ViewModel.AddFavorite(item.Title, item.ItemPublishDate, item.Link, item.ItemDetails); }