void GoogleLoginPage_Loaded(object sender, RoutedEventArgs e) { if (!GoogleAccount.IsConnected) { ShowProgressBar(true); // code to redirect to Google OAuth2 URL var oauthUrl = GetOauthUrl(); GLoginBrowser.Navigate(oauthUrl); } else { NavigationService.Navigate(new Uri("/Views/Birthdays.xaml", UriKind.RelativeOrAbsolute)); } }