Exemplo n.º 1
0
        private void LoadRecipe(RecipeShort shortRecipe)
        {
            string documentsPath = Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);

            documentsPath = Path.Combine(documentsPath, "recipes", shortRecipe.Id + ".json");

            using (StreamReader r = new StreamReader(documentsPath))
            {
                string json = r.ReadToEnd();
                Recipe = Newtonsoft.Json.JsonConvert.DeserializeObject <Recipe>(json);
            }
        }
Exemplo n.º 2
0
 public void DeleteFromList(RecipeShort recipe)
 {
     Recipes.Delete(recipe);
     ShortRecipeList.ItemsSource = Recipes.items;
 }
Exemplo n.º 3
0
 public ViewRecipePage(RecipeShort shortRecipe)
 {
     InitializeComponent();
     LoadRecipe(shortRecipe);
     DisplayRecipe();
 }
Exemplo n.º 4
0
        public void Delete(RecipeShort recipe)
        {
            int ind = items.IndexOf(el => el.Id == recipe.Id);

            items.RemoveAt(ind);
        }