private async void BtnLogin_Click(object sender, RoutedEventArgs e) { try { bool isAuthenticate = await TSGTwitterManager.UserAuthenticate(); if (isAuthenticate == true) { Frame.Navigate(typeof(TwitterUserInfo)); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("-------MainPage---btnTwitterLogin_Click------" + ex.Message); } }
protected async override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); try { await TSGTwitterManager.FriendsListAsync(); if (GlobalVariable.lstTwitterFriendList != null) { if (GlobalVariable.lstTwitterFriendList.Count > 0) { lstFriendList.DataContext = GlobalVariable.lstTwitterFriendList.OrderBy(x => x.Name).ToList(); } } } catch (Exception ex) { } }
private async void AppBarButton_Click(object sender, RoutedEventArgs e) { try { string struserInput = txtsearch.Text.Trim(); if (!string.IsNullOrEmpty(struserInput)) { var SeacrhResult = await TSGTwitterManager.SearchTweet(struserInput); if (SeacrhResult != null) { lstTweetList.ItemsSource = SeacrhResult; } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("-------SerachTweet---AppBarButton_Click------" + ex.Message); } }
private async void TweetButton_Click(object sender, RoutedEventArgs e) { try { string struserInput = txtTweet.Text.Trim(); if (!string.IsNullOrEmpty(struserInput)) { var TweetResult = await TSGTwitterManager.PostTweet(struserInput); if (TweetResult.Item1 == true) { await new MessageDialog("You Tweeted: " + TweetResult.Item2.Text, "Success!").ShowAsync(); } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("-------Posttweet---TweetButton_Click------" + ex.Message); } }
private void Logout_Click(object sender, RoutedEventArgs e) { TSGTwitterManager.TwitterLogout(); Frame.Navigate(typeof(TwitterMainPage)); }