/// <summary>
        /// Creates the view model.
        /// </summary>
        public BusStopControlViewModel(Stop stop)
        {
            this.StopId = stop.StopId;
            this.StopName = stop.Name;            
            this.Latitude = stop.Latitude;
            this.Longitude = stop.Longitude;
            this.Direction = stop.Direction;
            this.IsClosestStop = stop.IsClosestStop;

            this.stop = stop;
            this.stop.PropertyChanged += OnStopPropertyChanged;
        }
 /// <summary>
 /// Selects a bus stop by a stop object. To do this we need to go through all
 /// of the map controls and find the one whose view model stop id matches the stop.
 /// </summary>
 public void SelectStop(Stop stop, bool zoomToStop = false)
 {
     this.SelectedBusStop = new BusStopControlViewModel(stop);
     if (zoomToStop)
     {
         this.MapView = new MapView(new Point(stop.Latitude, stop.Longitude), this.mapView.ZoomLevel, true);
     }
 }
Ejemplo n.º 3
0
 public override int GetHashCode()
 {
     return(Stop.GetHashCode() ^ Route.GetHashCode());
 }