public App() { InitializeComponent(); DependencyService.Register <NavigationService>(); DependencyService.Register <AzureQuestionService>(); if (AuthStorage.HasLoggedIn) { AuthStorage.LoadSavedUserDetails(client); App.NavigateToExamPage(); } else { App.NavigateToSigninPage(); } }
async Task LoginToAuthenticationProvider(MobileServiceAuthenticationProvider provider) { // Check that we don't have a saved login if (AuthStorage.HasLoggedIn) { // Automatically load the credentials if we have AuthStorage.LoadSavedUserDetails(client); App.NavigateToExamPage(); return; } // Perform the login var loginService = DependencyService.Get <IAzurePlatformLogin>(); client.CurrentUser = await loginService.PerformLogin(client, provider); // Save the fact that we have logged in if (client.CurrentUser != null) { AuthStorage.SaveUserDetails(client); App.NavigateToExamPage(); } }