using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.Helper;
using FryPot_DosingSystem.Model;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace FryPot_DosingSystem.ViewModel
{
internal class NewRecipeViewModel : ObservableObject
{
///
/// 配方唯一编码,用于编辑配方
///
public string recipeId { get; set; }
///
/// 配方名称
///
private string _recipeName;
public string RecipeName { get { return _recipeName; } set { _recipeName = value; OnPropertyChanged(); } }
private int _recipeRollerNum;
///
/// 配方中桶数
///
public int RecipeRollerNum { get { return _recipeRollerNum; } set { _recipeRollerNum = value; OnPropertyChanged(); } }
public ObservableCollection materials { get; set; } = new ObservableCollection();
public ObservableCollection materialNames { get; set; } = new ObservableCollection();
public RelayCommand AddRecipe { get; set; }
public RelayCommand RemoveRecipe { get; set; }
public RelayCommand Comfirm { get; set; }
public RelayCommand SaveAs { get; set; }
public NewRecipeViewModel()
{
Json.Read();
MaterialNames.GetInstance.Names = Json.Data.Names;
materialNames = Json.Data.Names;
ActionManage.GetInstance.Register(new Action