public void UpdateWith(IncubatorViewModel incuModel) { InUse = incuModel.PokemonId > 0; PokemonId = incuModel.PokemonId; UsesRemaining = incuModel.UsesRemaining; KM = incuModel.KM; TotalKM = incuModel.TotalKM; RaisePropertyChanged("InUse"); RaisePropertyChanged("PokemonId"); RaisePropertyChanged("UsesRemaining"); RaisePropertyChanged("TotalKM"); RaisePropertyChanged("KM"); }
private void AddOrUpdateIncubator(EggIncubator incu) { var incuModel = new IncubatorViewModel(incu); var existing = Incubators.FirstOrDefault(x => x.Id == incu.Id); if (existing != null) { existing.UpdateWith(incuModel); } else { Incubators.Add(incuModel); } }
public void AddOrUpdate(PokemonData egg, IncubatorViewModel incu = null) { var eggModel = new EggViewModel(egg); eggModel.Hatchable = incu == null; var existing = this.Eggs.FirstOrDefault(x => x.Id == eggModel.Id); if (existing != null) { existing.UpdateWith(eggModel); } else { this.Eggs.Add(eggModel); } }
public void AddOrUpdate(PokemonData egg, IncubatorViewModel incu = null) { var eggModel = new EggViewModel(egg); eggModel.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); } }