public void OnNavigatedTo(NavigationEventArgs e)
 {
     Pushpins.Clear();
     EventSelected = (Event)e.Parameter;
     if (EventSelected.PointsOfInterest == null)
     {
         EventSelected.PointsOfInterest = new ObservableCollection <PointOfInterest>();
     }
     else
     {
         SavedPointsOfInterest = new ObservableCollection <PointOfInterest>(EventSelected.PointsOfInterest);
         foreach (PointOfInterest p in EventSelected.PointsOfInterest)
         {
             BasicGeoposition position = new BasicGeoposition()
             {
                 Latitude  = p.Latitude,
                 Longitude = p.Longitude
             };
             Pushpins.Add(new MapIcon()
             {
                 Location = new Geopoint(position),
                 NormalizedAnchorPoint = new Point(0.5, 1),
                 Title = p.Name
             });
         }
     }
 }
Пример #2
0
        void UpdateMapElements(GeoCoordinate currentLoc)
        {
            Center = currentLoc;
            Pushpins.Clear();
            Pushpins.Add(new Pushpin {
                Location = currentLoc
            });
            Speed    = (currentLoc.Speed * 3.6).ToString();
            Altitude = currentLoc.Altitude.ToString();

            if (IsRecording == false)
            {
                return;
            }

            RouteLocations.Add(currentLoc);

            if (RouteLocations.Count - 2 >= 0)
            {
                Distance = Distance + RouteLocations[RouteLocations.Count - 2].GetDistanceTo(currentLoc);
            }
            if (Routes.Count == 0)
            {
                var routeModel = new RouteModel(RouteLocations);
                Routes.Add(routeModel);
                Route = routeModel;
            }
            NotifyPropertyChanged(() => Route);
            NotifyPropertyChanged(() => Routes);
        }
 private void _drawHaltestellen(IEnumerable <IHaltestelle> haltestellen)
 {
     Pushpins.Clear();
     foreach (IHaltestelle haltestelle in haltestellen)
     {
         Location location = new Location(haltestelle.Location.X, haltestelle.Location.Y);
         Pushpins.Add(new VtmPushpin()
         {
             Haltestelle = haltestelle, Location = location
         });
     }
 }
 public void CancelPointsOfInterest()
 {
     if (SavedPointsOfInterest == null)
     {
         EventSelected.PointsOfInterest.Clear();
     }
     else
     {
         EventSelected.PointsOfInterest = SavedPointsOfInterest;
     }
     Pushpins.Clear();
     _navigationService.NavigateTo("EventsPage", EventSelected);
 }
Пример #5
0
        public void UpdatePins()
        {
            Pushpins.Clear();
            foreach (PushpinModel p in listModels)
            {
                Pushpins.Add(p);
            }
            NotifyPropertyChanged("Pushpins");

            // Make sure we still have the right ApplicationBar
            if (ApplicationBar != _mainAppBar)
            {
                ApplicationBar = _mainAppBar;
            }
        }
Пример #6
0
 public void Reset()
 {
     Pushpins.Clear();
     Lines.Clear();
 }