Questions? Feedback? powered by Olark live chat software
Přeskočit navigaci

Code sample test

Publikováno dne 1 listopadu, 2012

protectedasyncoverridevoid OnNavigatedTo(NavigationEventArgs e)

{

    while (App.MobileService.CurrentUser == null)

    {

        bool cancelled = false;

 

        try

        {

            awaitApp.MobileService.LoginAsync(

                MobileServiceAuthenticationProvider.Twitter);

        }

        catch (InvalidOperationException)

        {

            cancelled = true;

        }

 

        if (cancelled)

        {

            awaitnew Windows.UI.Popups.MessageDialog(

                    "You must login to use this app", "Login").ShowAsync();

        }

    }

 

    RefreshTodoItems();

}