Beispiel #1
0
        public Application()
        {
            ourRecipes = new RecipeBook(); // TODO make this load from a file

            // Pretending now...
            ourRecipes.AddRecipe(
                new Recipe
            {
                Name        = "My Great Recipe",
                Summary     = "The best recipe you've never had",
                Description = "Combine the ingredients in a large bathtub. Simmer until gelatinous. Eat with spork.",
                Category    = RecipeCategory.Bread,
                Ingredients = new[] { new Ingredient {
                                          Quantity = 5
                                          , Unit   = "cups"
                                          , Name   = "Sugar"
                                      }
                                      , new Ingredient {
                                          Quantity = 5
                                          , Unit   = "loaves"
                                          , Name   = "Bread"
                                      }
                                      , new Ingredient {
                                          Quantity = 0.5
                                          , Unit   = "tbsp"
                                          , Name   = "Yeast"
                                      } }
            });

            ourRecipes.AddRecipe(
                new Recipe {
                Name          = "Water"
                , Summary     = "Water"
                , Description = "HYDRATE"
                , Category    = RecipeCategory.Drinks
                , Ingredients =
                    new[] { new Ingredient {
                                Quantity = 1
                                , Unit   = "atom"
                                , Name   = "Oxygen"
                            }
                            , new Ingredient {
                                Quantity = 2
                                , Unit   = "atoms"
                                , Name   = "Hydrogen"
                            } }
            });
        }
Beispiel #2
0
 public void AddRecipe()
 {
     RecipeBook.AddRecipe(NewRecipe);
     SelectedRecipe  = NewRecipe;
     SelectedRecipes = new ObservableCollection <Recipe>(RecipeBook.Recipes.Where(r => r.Type.Name == SelectedRecipe.Type.Name));
     NewRecipe       = new Recipe();
 }