/// <summary> /// Remove item from EntityNavigationItemViewModels list, /// when a Deleted event in a created Entity DetailViewModel was fired /// </summary> /// <param name="eventAfterDetailDeletedArgs"></param> public void OnEventAfterDetailDeleted(EventAfterDetailDeletedArgs eventAfterDetailDeletedArgs) { if (eventAfterDetailDeletedArgs.ViewModelName == NameOfDetailViewModel()) { var entityNavigationItemViewModel = EntityNavigationItemViewModels.SingleOrDefault(k => k.Id == eventAfterDetailDeletedArgs.Id); if (entityNavigationItemViewModel != null) { EntityNavigationItemViewModels.Remove(entityNavigationItemViewModel); } } }
/// <summary> /// Removes ViewModel, identified by the combination of the event arguments, from ViewModels list, after Detail (Entity) was deleted. /// </summary> /// <param name="eventAfterDetailDeletedArgs">Id and Name of the ViewModel</param> private void OnEventAfterDetailDeleted(EventAfterDetailDeletedArgs eventAfterDetailDeletedArgs) { RemoveViewModel(eventAfterDetailDeletedArgs.Id, eventAfterDetailDeletedArgs.ViewModelName); }