private void ResetSelectedStationsAndStationConnections() { Stations.Where(s => s.IsSelectedStationInThePath == false | true) .ToList().ForEach(s => { s.IsSelectedStationInThePath = null; }); StationConnections.Where(sc => sc.IsSelectedConnection == false | true) .ToList().ForEach(sc => { sc.IsSelectedConnection = null; }); }
private void HideStationsAndConnectionsThatIsNotOnTheSelectedPath() { StationConnections.Where(sc => sc.IsSelectedConnection == null) .ToList().ForEach(sc => { sc.IsSelectedConnection = false; }); Stations.Where(s => s.IsSelectedStationInThePath == null) .ToList().ForEach(s => { s.IsSelectedStationInThePath = false; }); }
public void MoveToPrevious(StationViewModel startStation, StationViewModel endStation) { while (startStation.ConnectedStationO.PreviousStation != endStation.Name) { startStation = Stations.ToList().Find(s => s.Name.Trim() == startStation.ConnectedStationO.PreviousStation.Trim()); StationConnections.SingleOrDefault(s => { if (s.NextStation != null & s.NextStation.Trim() == startStation.ConnectedStationO.NextStation.Trim()) { s.IsSelectedConnection = true; return(true); } return(false); }); startStation.IsSelectedStationInThePath = true; } }