private void LoadWebMapButton_Click(object sender, System.Windows.RoutedEventArgs e)
{
IdentityManager.Current.GenerateCredentialAsync("https://www.arcgis.com", UsernameTextBox.Text, PasswordTextBox.Password,
(credential, ex) =>
{
if (ex == null)
{
Document webMap = new Document();
webMap.Token = credential.Token;
webMap.GetMapCompleted += webMap_GetMapCompleted;
webMap.GetMapAsync(WebMapTextBox.Text);
}
}, null);
}