public void AddOrUpdate(PokemonData egg, IncubatorViewModel incu = null) { var eggModel = new EggViewModel(egg) { Hatchable = incu == null }; var existing = Eggs.FirstOrDefault(x => x.Id == eggModel.Id); if (existing != null) { // Do not update, it overwrites OnEggIncubatorStatus Status updates // existing.UpdateWith(eggModel); } else { Eggs.Add(eggModel); } }
public void UpdateWith(EggViewModel e) { KM = e.KM; RaisePropertyChanged("KM"); }