public void CreateACat() { if (Equals(null, _model)) { return; } Cat cat = new Cat(); CatProperties dlg = new CatProperties(cat); if (DialogResult.OK == dlg.ShowDialog()) { _model.SaveObject <Cat>(cat); // Refresh the cats list Cats.Add(cat); Cats.Sort((catA, catB) => catA.CompareTo(catB)); } if (!Equals(null, OnNewCatsAvailable)) { OnNewCatsAvailable(this); } }