Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9202209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:12:03+00:00 2026-06-17T23:12:03+00:00

I am basically trying to run my authorization process for my WinRt app synchronously,

  • 0

I am basically trying to run my authorization process for my WinRt app synchronously, but everything I’ve tried appears to deadlock the app after authorization on the MainPage, preventing navigation to the HomePage. Can’t seem to figure it out. Here is my code without modifications, which works perfectly fine asynchronously below. How can I make this work synchronously:

Class:

public async void InitializeTwitterAsnc()
    {

        WinRtAuthorizer authorizer = null;

        authorizer = new WinRtAuthorizer()
        {
            Credentials = new LocalDataCredentials()
            {
                ConsumerKey = "blah379",
                ConsumerSecret = "blah123"
            },
            UseCompression = true,
            Callback = new Uri("http://blah.com")
        };

        if(!authorizer.IsAuthorized)
        {
            await authorizer.AuthorizeAsync();
        }

        // set the twitter credential fields
        await Task.Run
            (() =>
                 {
                     twitterName = authorizer.Credentials.ScreenName;
                     twitterId = authorizer.Credentials.UserId;
                     accessToken = authorizer.Credentials.AccessToken;
                     oAuthToken = authorizer.Credentials.OAuthToken;

                     this.TwitterContext = new TwitterContext(authorizer);
                 });
    }

code that calls the method from MainPage.xaml.cs:

private void StartTwitterLogin(object sender, RoutedEventArgs e)
    {
        // start the twitter authorization
        TwitterAuth twitAuth = new TwitterAuth();
        twitAuth.InitializeTwitterAsnc();


        this.Frame.Navigate(typeof (HomePage));
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:12:04+00:00Added an answer on June 17, 2026 at 11:12 pm

    So ultimately, my solution was to handle the navigation inside the async twitAuth.InitializeTwitterAsync() method. In order for the navigation to work, I had to create a static frame property in the app.xaml.cs that I could use in my custom class for navigation. See this link WinRt page navigaiton .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to run this method, it works fine but every time after some
I'm trying to run a series of if/else statements but right now they basically
Basically I'm trying to run some code (Python 3.2) if a value on a
I'm trying to run this script that basically reads/interprets text in from a textfile
I'm trying to run a query on DBPedia.org via SPARQL. Basically, here's what I
I am trying to use JSON to populate a div, so I basically run
I'm basically trying to make my js and css files dynamic. I've tried a
I am basically getting this error when trying to run a stored procedure from
I'm trying to run a function in JQuery that basically shuts down or starts
I am trying to run a simple java program in linux but getting a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.