/// <summary>
 /// The route to base the view model on.
 /// </summary>
 public SearchRouteResultViewModel(Route route)
 {
     this.Route = route;
     this.SelectedCommand = new ObservableCommand();
     this.SelectedCommand.Executed += OnSelectedCommandExecuted;
 }
        /// <summary>
        /// Toggles filtering by a specific route.
        /// </summary>
        public void ToggleFilterByRoute(Route route)
        {
            if (this.isFiltered)
            {
                this.filteredRouteId = null;
                this.isFiltered = false;

                foreach (var realTimeData in this.realTimeData)
                {
                    realTimeData.IsFiltered = false;
                }
            }
            else
            {
                this.filteredRouteId = route.Id;
                this.isFiltered = true;

                foreach (var realTimeData in this.realTimeData)
                {
                    realTimeData.IsFiltered = string.Equals(this.filteredRouteId, realTimeData.RouteId, StringComparison.OrdinalIgnoreCase);
                }
            }

            FirePropertyChanged("RealTimeData");
        }
Ejemplo n.º 3
0
 public override int GetHashCode()
 {
     return(Stop.GetHashCode() ^ Route.GetHashCode());
 }