Example #1
0
 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);
     }
 }
Example #2
0
 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);
     }
 }
Example #3
0
        private void OnIngredientDeleted(DeleteMessage <IngredientWrapper> message)
        {
            var ingredient = IngredientDetailViewModels.SingleOrDefault(i => i.Model.Id == message.Id);

            if (ingredient != null)
            {
                IngredientDetailViewModels.Remove(ingredient);
            }
        }