终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

58 lines
2.0 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Microsoft.Toolkit.Mvvm.ComponentModel;
  7. using System.Collections.ObjectModel;
  8. using Microsoft.Toolkit.Mvvm.Input;
  9. using BPASmartClient.Helper;
  10. using BPASmartClient.JXJFoodSmallStation.Model;
  11. using BPASmartClient.CustomResource.Pages.Model;
  12. namespace BPASmartClient.JXJFoodSmallStation.ViewModel
  13. {
  14. public class RecipeInfosViewModel : ObservableObject
  15. {
  16. public RecipeInfosViewModel()
  17. {
  18. ActionManage.GetInstance.CancelRegister("RecipeInfo");
  19. ActionManage.GetInstance.Register(new Action<object>((o) =>
  20. {
  21. if (o != null && o is RemoteRecipeData rm)
  22. {
  23. RecipeName = rm.RecipeName;
  24. RecipeCode = rm.RecipeCode;
  25. TrayCode = rm.TrayCode;
  26. //RawMaterialsInfo = rm.RawMaterial;
  27. //var rest = RawMaterialsInfo.GetHashCode();
  28. foreach (var item in rm.RawMaterial)
  29. {
  30. RawMaterialsInfo.Add(item);
  31. }
  32. }
  33. }), "RecipeInfo");
  34. ReturnPage = new RelayCommand(() =>
  35. {
  36. ActionManage.GetInstance.Send("CloseRecipeInfosView");
  37. });
  38. }
  39. public string RecipeName { get { return _mRecipeName; } set { _mRecipeName = value; OnPropertyChanged(); } }
  40. private string _mRecipeName;
  41. public string RecipeCode { get { return _mRecipeCode; } set { _mRecipeCode = value; OnPropertyChanged(); } }
  42. private string _mRecipeCode;
  43. public int TrayCode { get { return _mTrayCode; } set { _mTrayCode = value; OnPropertyChanged(); } }
  44. private int _mTrayCode;
  45. public RelayCommand ReturnPage { get; set; }
  46. public ObservableCollection<RemoteRecipeRawMaterial> RawMaterialsInfo { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>();
  47. }
  48. }