public virtual void OnBirthEdited(Births birth) { var events = new BirthsEventArgs { Birth = birth }; BirthEdited?.Invoke(this, events); }
private void OnBirthDeleted(object sender, BirthsEventArgs e) { try { RemoveItemFromList(_birthsObservableList, e.Birth); } catch (Exception exception) { MessageBox.Show(exception.Message); } }
public virtual void OnBirthEdited(Births birth) { var events = new BirthsEventArgs { Birth = birth }; BirthEdited?.Invoke(this, events); //Using null propagation //if (VideoEncoded != null) //{ // VideoEncoded(this, EventArgs.Empty); //} }
public void OnBirthEdited(object sender, BirthsEventArgs e) { try { var birthIndex = _birthsObservableList.IndexOf(_birthsObservableList.FirstOrDefault(i => i.id == e.Birth.id)); _birthsObservableList[birthIndex] = e.Birth; } catch (Exception exception) { MessageBox.Show(exception.Message); // MessageBox.Show(exception.StackTrace); // MessageBox.Show(exception.Source); } }
public void OnBirthAdded(object sender, BirthsEventArgs e) { _birthsObservableList.Add(e.Birth); }
private void OnWeaningEdited(object sender, BirthsEventArgs e) { UpdateWeaning(e.Birth); }