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); }
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))); } }
private void Execute_Delete(object o) { // Question(); FoodsList.Remove(_select_Item); _select_Item = null; }