private async void LoadWebMap() { try { ArcGISPortal portal = new ArcGISPortal() { Url = "http://www.arcgis.com/sharing/rest" }; ArcGISPortalItem portalItem = new ArcGISPortalItem(portal) { Id = "00e5e70929e14055ab686df16c842ec1" }; WebMap webMap = await WebMap.FromPortalItemTaskAsync(portalItem); MyWebMapViewModel = await WebMapViewModel.LoadAsync(webMap, portalItem.ArcGISPortal); } catch (Exception ex) { if (ex is ServiceException) { MessageBox.Show(String.Format("{0}: {1}", (ex as ServiceException).Code.ToString(), (ex as ServiceException).Details[0]), "Error", MessageBoxButton.OK); return; } } }