private void OnCloseIngredientDetailTabExecute(object parameter) { if (parameter is IIngredientDetailViewModel ingredientDetailViewModel) { // TODO: Check if the Detail has changes and ask user to cancel IngredientDetailViewModels.Remove(ingredientDetailViewModel); } }
private void OnCloseIngredientDetailTabExecute(IIngredientDetailViewModel?ingredientDetailViewModel) { if (ingredientDetailViewModel is not null) { // TODO: Check if the Detail has changes and ask user to cancel IngredientDetailViewModels.Remove(ingredientDetailViewModel); } }
private void OnIngredientDeleted(DeleteMessage <IngredientWrapper> message) { var ingredient = IngredientDetailViewModels.SingleOrDefault(i => i.Model.Id == message.Id); if (ingredient != null) { IngredientDetailViewModels.Remove(ingredient); } }