private void OnRacesChanged(object source, NotifyCollectionChangedEventArgs args) { if (args.NewItems != null) { foreach (var item in args.NewItems) { if (item is Race race) { _db.UpdateRace(race, true); } } } if (args.OldItems != null) { foreach (var item in args.OldItems) { if (item is Race race) { _db.UpdateRace(race, false); } } } }
private void OnRaceRunsChanged(object source, EventArgs args) { _db.UpdateRace(_race, true); // Update the race run number; assume to be active (true) }