|
@@ -13,14 +13,12 @@ namespace FoodLogProject.ViewModels
|
|
|
{
|
|
|
|
|
|
#pragma warning disable CA1822 // Mark members as static
|
|
|
- static int id = 3;
|
|
|
public static GaruaevContext myConnection = new GaruaevContext();
|
|
|
public UserControl UC { get => uc; set => this.RaiseAndSetIfChanged(ref uc, value); }
|
|
|
public Page2ViewModel Page2VM { get => page2VM; set => page2VM = value; }
|
|
|
public Page6ViewModel Page6VM { get => page6VM; set => page6VM = value; }
|
|
|
public List<Recipe> ListRecipes { get => listRecipes; set => listRecipes = value; }
|
|
|
public List<RecipesIngredient> ListIngridient { get => listIngridient; set => listIngridient = value; }
|
|
|
- public static int Id { get => id; set => id = value; }
|
|
|
|
|
|
private UserControl uc = new Page1();
|
|
|
public void LoadPage2() => UC = new Page2();
|
|
@@ -46,13 +44,17 @@ namespace FoodLogProject.ViewModels
|
|
|
public void LoadPage5() => UC = new Page5();
|
|
|
public void LoadPage6() => UC = new Page6();
|
|
|
public void LoadPage7()
|
|
|
- {
|
|
|
- listIngridient = myConnection.RecipesIngredients.Include(x => x.Ingredient).Where(x => x.RecipeId == Id).ToList();
|
|
|
+ {
|
|
|
UC = new Page7();
|
|
|
}
|
|
|
private List<RecipesIngredient> listIngridient;
|
|
|
private List<Recipe> listRecipes = myConnection.Recipes.ToList();
|
|
|
|
|
|
+ public void LookRecipe(int Id)
|
|
|
+ {
|
|
|
+ listIngridient = myConnection.RecipesIngredients.Include(x => x.Ingredient).Where(x => x.RecipeId == Id).ToList();
|
|
|
+ UC = new Page7();
|
|
|
+ }
|
|
|
|
|
|
#pragma warning restore CA1822 // Mark members as static
|
|
|
}
|