private async void GLoginBrowser_Navigated(object sender, NavigationEventArgs e) { ShowProgressBar(true); string token = e.Uri.Query; if (e.Uri.Query.Contains("xsrf")) { string source = GLoginBrowser.SaveToString(); int start = source.IndexOf("<title>") + 20; int end = source.IndexOf("</title>"); string authCode = source.Substring(start, end - start); bool completed = await GoogleAccount.Authorize(authCode); while (!completed) { ; } ShowProgressBar(false); NavigationService.Navigate(new Uri("/Views/Birthdays.xaml", UriKind.RelativeOrAbsolute)); } }