Пример #1
0
        public async void AddProduct(SelectableProduct prod)
        {
            IngredientModel ingredient = new IngredientModel
            {
                ProductName      = prod.Product.Name,
                ProductId        = prod.Product.Id,
                UnitQuantity     = prod.CurrentUnitQuantityTypeVolume,
                UnitQuantityType = prod.UnitQuantityType,
                RecipeId         = RecipeId
            };

            await RecipeService.InsertIngredient(ingredient);

            await OnIngredientAdded.InvokeAsync(ingredient);

            prod.IsAdding = false;
        }
Пример #2
0
 public void SetIsAdding(SelectableProduct cnt)
 {
     Products.ForEach(p => p.IsAdding = false);
     cnt.IsAdding = true;
 }