|
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using BPASmartClient.MorkCL.Model.DataInfo;
-
- namespace BPASmartClient.MorkCL.ViewModel
- {
- public class AddRawMaterialViewModel:NotifyBase
- {
- public AddRawMaterialViewModel()
- {
-
- InitialTestData();
- RemoveAccessoryCommand = new BPARelayCommand<string>((Id) =>
- {
- Accessories.Remove(Accessories.FirstOrDefault(a=>a.Id==Id));
- });
- }
-
- private void InitialTestData()
- {
- Accessories = new ObservableCollection<AccessoriesInfo>();
- for (int i = 0; i < 8; i++)
- {
- Accessories.Add(new AccessoriesInfo() { Id = i.ToString(), Name = $"第{i}样", Loc = i });
- }
- Ingredients = new();
- for (int i = 0; i < 12; i++)
- {
- Ingredients.Add(new IngredientsInfo() { Id = i.ToString(), Name = $"第{i}样"});
- }
- Seasonings = new();
- for (int i = 0; i < 3; i++)
- {
- Seasonings.Add(new SeasoningInfo() { Id = i.ToString(), Name = $"第{i}样", Loc = i });
- }
- }
-
- /// <summary>
- /// 辅料信息集合
- /// </summary>
- public ObservableCollection<AccessoriesInfo> Accessories { get; set; }
- /// <summary>
- /// 主料信息集合
- /// </summary>
- public ObservableCollection<IngredientsInfo> Ingredients { get; set; }
- /// <summary>
- /// 调料信息集合
- /// </summary>
- public ObservableCollection<SeasoningInfo> Seasonings { get; set; }
-
- /// <summary>
- /// 删除辅料信息
- /// </summary>
- public BPARelayCommand<string> RemoveAccessoryCommand { get;set; }
-
- /// <summary>
- /// 删除主料信息
- /// </summary>
- public BPARelayCommand<string> RemoveIngreditentCommand { get; set; }
-
-
- /// <summary>
- /// 删除调料信息
- /// </summary>
- public BPARelayCommand<string> RemoveSeasoningCommand { get; set; }
- }
- }
|