/// <summary>
 /// Opens the Add ingredient to Shopping Basket window
 /// </summary>
 /// <param name="addIngredientOpen">Window that we open</param>
 public AddIngredientToBasketViewModel(AddIngredientToRecipe addIngredientOpen)
 {
     ingredient            = new tblIngredient();
     addIngredientToRecipe = addIngredientOpen;
     IngredientList        = ingrediantsData.GetAllIngredients().ToList();
     IngrediantAmountList  = shoppingData.GetAllSelectedShoppingBasketItems(LoggedGuest.ID).ToList();
 }
 public AddIngredientToRecipeWindowViewModel(AddIngredientToRecipeWindow addIngredientToRecipeWindow)
 {
     this.addIngredientToRecipeWindow = addIngredientToRecipeWindow;
     ingredient           = new tblIngredient();
     ItemAmount           = new tblShoppingBasket();
     IngredientList       = ingrediantsData.GetAllIngredients().ToList();
     IngrediantAmountList = shoppingData.GetAllSelectedShoppingBasketItems(LoggedGuest.ID).ToList();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Constructor with the AllShoppingList info window opening
 /// </summary>
 /// <param name="allShoppingWindowOpen">opends the window</param>
 public AllShoppingListViewModel(AllShoppingList allShoppingWindowOpen)
 {
     allShoppingListWindow               = allShoppingWindowOpen;
     bgWorker.DoWork                    += WorkerOnDoWork;
     bgWorker.WorkerReportsProgress      = true;
     bgWorker.WorkerSupportsCancellation = true;
     bgWorker.ProgressChanged           += WorkerOnProgressChanged;
     bgWorker.RunWorkerCompleted        += WorkerOnRunWorkerCompleted;
     ProgressBarVisibility               = Visibility.Collapsed;
     ButtonVisibility                    = Visibility.Visible;
     ShoppingBasketList                  = shoppingData.GetAllSelectedShoppingBasketItems(LoggedGuest.ID).ToList();
     StorageList = storagedata.GetAllSelectedIngredientStorageItems(LoggedGuest.ID).ToList();
     storagedata.OnNotification += storagedata.AddIngredientStorage;
 }