Created
December 6, 2014 20:49
-
-
Save scionwest/0bd98de7af7546216912 to your computer and use it in GitHub Desktop.
App Startup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected async override Task OnLaunchApplicationAsync(LaunchActivatedEventArgs args) | |
{ | |
try | |
{ | |
// Try to restore the user. | |
IUserService userService = this.container.Resolve<IUserService>(); | |
User user = await userService.RetrieveUser(); | |
// If the user was restored, we can navigate to the main page. | |
NavigationService.Navigate("Main", user); | |
} | |
catch (UserNotAuthenticatedException) | |
{ | |
// If the user restore failed, they must sign back in. | |
NavigationService.Navigate("FirstRun", null); | |
} | |
Window.Current.Activate(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment