void OnNewAge(object sender, AgeIncrementingEventArgs e) { if (!(e.Participant is ParticipantListItemViewModel participant)) { participant = ((List <ParticipantListItemViewModel>)AllParticipants.SourceCollection).First(p => p.Id == e.Participant.Id); participant.AgeDays = e.Participant.AgeDays; } AllParticipants.EditItem(participant); if (participant.IsKnownDead == true || participant.AgeDays > 28) { e.Remove = true; } AllParticipants.CommitEdit(); }
void OnNewAge(object sender, AgeIncrementingEventArgs e) { _repository_ParticipantUpdated(null, new ParticipantEventArgs(_repository.FindParticipant(e.Participant.Id))); }