private void wbTwitter_Loaded(object sender, RoutedEventArgs e) { accessToken = TwitterHelper.GetKeyValue <string>("AccessToken"); accessTokenSecret = TwitterHelper.GetKeyValue <string>("AccessTokenSecret"); userScreenName = TwitterHelper.GetKeyValue <string>("ScreenName"); if (string.IsNullOrEmpty(accessToken) || string.IsNullOrEmpty(accessTokenSecret)) { var requestTokenQuery = TwitterOAuthHelper.GetRequestTokenQuery(); requestTokenQuery.RequestAsync(AppSettings.TwitterRequestTokenUri, null); requestTokenQuery.QueryResponse += new EventHandler <WebQueryResponseEventArgs>(requestTokenQuery_QueryResponse); } else { Dispatcher.BeginInvoke(() => { var tweetButton = (Microsoft.Phone.Shell.ApplicationBarIconButton) this.ApplicationBar.Buttons[3]; tweetButton.IsEnabled = true; }); } }