private void ShowRouteDetails(RoutesListItemViewModel routeVM) { if (routeVM.Routes.Count > 1) { var routeListNavParam = new RouteListNavParam(); foreach (var route in routeVM.Routes) { routeListNavParam.Routes.Add( new RouteListItem( route.Id, route.Name, route.Number, $"{route.FirstStop.Name} — {route.LastStop.Name}", route.VehicleType)); } this.ShowViewModel <SetRouteViewModel>(new { routes = JsonConvert.SerializeObject(routeListNavParam) }); } else { this.ShowViewModel <RouteVehiclesViewModel>(new { routeId = routeVM.Routes.First().Id, routeName = routeVM.Name, routeNumber = routeVM.Routes.First().Number, vehicleType = routeVM.VehicleType }); } }
private void UpdateSelectedRoute() { if (this.SelectedRoute != null) { this.SelectedRoute = _routes.FirstOrDefault(r => r.Id.Equals(this.SelectedRoute.Id)); } }