private async Task PopulateMapAsync() { var idsAsString = NavigationNearbyStationIdList.Split(new char[] { ',' }); var ids = idsAsString.Select(Int32.Parse).ToList(); var hst = await _dataService.GetHaltestellenAsync(ids); var mapPins = new List<MapHaltestelleModel>(); foreach (var h in hst) { try { var mapHst = new MapHaltestelleModel() { Id = h.Id, Bezeichnung = h.Bezeichnung, GeoCoordinate = new GeoCoordinate(h.Latitude, h.Longitude) }; mapPins.Add(mapHst); } catch (Exception) { // ArgumentOutOfRangeException from new GeoCoordinate(..., ...): we then do not show this station } } NearbyStations = new BindableCollection<MapHaltestelleModel>(mapPins); NotifyOfPropertyChange(() => NearbyStations); _eventAggregator.Publish(new ZoomMapToPinsMessage(), _eventAggregator.PublishOnUIThread); }
public void Show(MapHaltestelleModel h) { _navigationService.UriFor<StationInfoPivotPageViewModel>() .WithParam(m => m.NavigationStationId, h.Id) .Navigate(); }