using System; using System.Linq; using System.Windows; namespace MahTweets.Mobile.TwitterPlugin { public partial class TweetActionsBar { private Twitter parent; public TweetActionsBar() { InitializeComponent(); this.Loaded += new RoutedEventHandler(TweetActionsBarLoaded); } void TweetActionsBarLoaded(object sender, RoutedEventArgs e) { parent = ((Twitter)Update.Parents.FirstOrDefault()); } private void ReplyMenuItemClick(object sender, RoutedEventArgs e) { if (parent == null) { MessageBox.Show("You can't reply to a tweet if you dont have a Twitter account setup!"); return; } NavigationService.Navigate(new Uri("/Views/CompositionView.xaml?ID=" + Update.ID, UriKind.RelativeOrAbsolute)); } private void RetweetMenuItemClick(object sender, RoutedEventArgs e) { if (parent == null) { MessageBox.Show("You can't retweet to a tweet if you dont have a Twitter account setup!"); return; } parent.Retweet(Update.ID); } private void FavMenuItemClick(object sender, RoutedEventArgs e) { if (parent == null) { MessageBox.Show("You can't favourite to a tweet if you dont have a Twitter account setup!"); return; } parent.Favourite(Update.ID); } private void BtnLinksClick(object sender, RoutedEventArgs e) { ViewLinks(); } private void BtnMoreClick(object sender, RoutedEventArgs e) { if (parent == null) { MessageBox.Show("You can't reply to a tweet if you dont have a Twitter account setup!"); return; } else NavigationService.Navigate(new Uri("/MahTweets.Mobile.TwitterPlugin;component/Views/SingleTweetView.xaml?Id=" + Update.ID + "&Parent=" + parent.Credentials.AccountName, UriKind.RelativeOrAbsolute)); } } }