Exemple #1
0
        public override string ToString()
        {
            string result = "";

            FoodsList.ForEach(x => result += string.Format("{0} of {1}, ", x.Amount, x.Name));
            result.TrimEnd(new char[] { ',' });

            return(result);
        }
Exemple #2
0
        private void Execute(object o)
        {
            Add_food myAdd = new Add_food();

            myAdd.Title = "Создание рецепта";
            AddViewModel myViewModel = new AddViewModel();

            myAdd.DataContext = myViewModel;

            if (myViewModel.CloseAction == null)
            {
                myViewModel.CloseAction = new Action(myAdd.Close);
            }


            myAdd.ShowDialog();

            if (myViewModel.is_ok == true)
            {
                FoodsList.Add(new FoodViewModel(new Food(myViewModel.Name_food, myViewModel.Image_path, myViewModel.Info_food, myViewModel.List_ingridient)));
            }
        }
Exemple #3
0
 private void Execute_Delete(object o)
 {
     // Question();
     FoodsList.Remove(_select_Item);
     _select_Item = null;
 }