private void SignInButton_Click(object sender, RoutedEventArgs e)
{
ResultsListBox.ItemsSource = null;
WebmapContent.Children.Clear();
IdentityManager.Current.GenerateCredentialAsync(DEFAULT_SERVER_URL, UsernameTB.Text, PasswordTB.Password, (crd, ex) =>
{
if (crd != null)
{
IdentityManager.Current.AddCredential(crd);
portal.InitializeAsync(DEFAULT_SERVER_URL, (credential, exception) =>
{
if (credential != null && credential.CurrentUser != null)
{
ResetVisibility();
(ApplicationBar.Buttons[0] as IApplicationBarIconButton).Text = "Sign Out";
}
});
}
else
{
MessageBox.Show("Could not log in. Please check credentials.");
}
});
}