Exemplo n.º 1
0
 private void DeleteRecipe(object obj)
 {
     if (selectedRecipe != null)
     {
         if (MessageBox.Show("Do you want to delete the selected recipe ?", "Confirm", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes)
         {
             if (dbActions.DeleteRecipe(new CookBookData.Model.Recipe {
                 Id = selectedRecipe.Id
             }))
             {
                 //recipeItems.Remove(selectedRecipe);
                 searchedRecipeItems.Remove(selectedRecipe);
                 // ToDo: clear Recipe-Ingredient and Recipe-Steps listviews
                 ingredientItems.Clear();
                 steps.Clear();
             }
         }
     }
 }