Beispiel #1
0
        public NewDrinkVM(IDrinkService drinkService)
        {
            _drinkService      = drinkService;
            _navigationService = App.NavigationService;
            IngredientList     = new ObservableCollection <Ingredient>();
            IngredientList.Add(new Ingredient {
                AmountInt = 0
            });
            IngredientList.Add(new Ingredient {
                AmountInt = 0
            });
            IngredientList.Add(new Ingredient {
                AmountInt = 0
            });
            IngredientList.Add(new Ingredient {
                AmountInt = 0
            });
            IngredientList.Add(new Ingredient {
                AmountInt = 0
            });
            IngredientList.Add(new Ingredient {
                AmountInt = 0
            });

            Drink = new Drink {
                Name = "-", Description = "-", Ingredients = IngredientList
            };
            IngredientSelection constants = new IngredientSelection();

            IngredientSelection = constants.GetIngredientSelection().OrderBy(t => t.Name).ToList();
        }
Beispiel #2
0
        public ConfigVM(IDrinkService drinkService, IConfigurationService configurationService)
        {
            _configurationService = configurationService;
            _navigationService    = App.NavigationService;
            IngredientList        = new ObservableCollection <Ingredient>();
            Task.Run(() => GetConfig());

            IngredientSelection constants = new IngredientSelection();

            IngredientSelection = constants.GetIngredientSelection().OrderBy(t => t.Name).ToList();
        }