终端一体化运控平台
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

56 linhas
1.9 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.JXJFoodBigStation.Model;
  11. using BPASmartClient.CustomResource.Pages.Model;
  12. namespace BPASmartClient.JXJFoodBigStation.ViewModel
  13. {
  14. public class RecipeInfosViewModel : ObservableObject
  15. {
  16. public RecipeInfosViewModel()
  17. {
  18. ActionManage.GetInstance.Register(new Action<object>((o) =>
  19. {
  20. if (o != null && o is RemoteRecipeData rm)
  21. {
  22. RecipeName = rm.RecipeName;
  23. RecipeCode = rm.RecipeCode;
  24. TrayCode = rm.TrayCode;
  25. //RawMaterialsInfo = rm.RawMaterial;
  26. //var rest = RawMaterialsInfo.GetHashCode();
  27. foreach (var item in rm.RawMaterial)
  28. {
  29. RawMaterialsInfo.Add(item);
  30. }
  31. }
  32. }), "RecipeInfo");
  33. ReturnPage = new RelayCommand(() =>
  34. {
  35. ActionManage.GetInstance.Send("CloseRecipeInfosView");
  36. });
  37. }
  38. public string RecipeName { get { return _mRecipeName; } set { _mRecipeName = value; OnPropertyChanged(); } }
  39. private string _mRecipeName;
  40. public long RecipeCode { get { return _mRecipeCode; } set { _mRecipeCode = value; OnPropertyChanged(); } }
  41. private long _mRecipeCode;
  42. public int TrayCode { get { return _mTrayCode; } set { _mTrayCode = value; OnPropertyChanged(); } }
  43. private int _mTrayCode;
  44. public RelayCommand ReturnPage { get; set; }
  45. public ObservableCollection<RemoteRecipeRawMaterial> RawMaterialsInfo { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>();
  46. }
  47. }