private void RemoveCampFromRoute(SelectCampViewModel camp) { camp.Selected = false; var stop = Route.Stops.FirstOrDefault(s => s.Camp.Id == camp.Camp.Id); if (stop != null) { Route.Stops.Remove(stop); } }
private void AddCampToRoute(SelectCampViewModel camp) { camp.Selected = true; var stop = new Stop() { Complete = false, Camp = camp.Camp }; Route.Stops.Add(stop); }
public void OnCampSelected(SelectCampViewModel camp) { if (CampIsInRoute(camp)) { RemoveCampFromRoute(camp); } else { AddCampToRoute(camp); } }
private void RemoveCampFromRoute(SelectCampViewModel camp) { camp.Selected = false; // TODO: use Id instead of Name - Id is null currently var stop = Route.Stops.FirstOrDefault(s => s.Value.Camp.Id == camp.Camp.Key); if (stop.Value != null) { Route.Stops.Remove(stop.Key); } }
private void AddCampToRoute(SelectCampViewModel camp) { camp.Selected = true; camp.Camp.Object.Id = camp.Camp.Key; var stop = new Stop() { Complete = false, Camp = camp.Camp.Object }; Route.Stops.Add(Guid.NewGuid().ToString(), stop); }
private bool CampIsInRoute(SelectCampViewModel camp) { return(Route.Stops.Exists(s => s.Camp.Id == camp.Camp.Id)); }
private bool CampIsInRoute(SelectCampViewModel camp) { // TODO: use Id instead of Name - Id is null currently return(Route.Stops.ToList().Exists(s => s.Value.Camp.Name == camp.Camp.Object.Name)); }