AlignerViewModel.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using Aitex.Core.UI.MVVM;
  2. using Aitex.Sorter.Common;
  3. using Aitex.Sorter.UI.Controls.Common;
  4. using MECF.Framework.Common.OperationCenter;
  5. using System.Collections.Generic;
  6. using System.Windows;
  7. using System.Windows.Input;
  8. namespace Aitex.Sorter.UI.ViewModel.Maintenance
  9. {
  10. public class AlignerViewModel : UIViewModelBase
  11. {
  12. public AlignerViewModel(string vmName) : base(vmName)
  13. {
  14. Command = new DelegateCommand<DependencyObject>(DoCommand);
  15. }
  16. public bool AlignerInitialized
  17. {
  18. get;
  19. set;
  20. }
  21. public bool AlignerIsBusy
  22. {
  23. get;
  24. set;
  25. }
  26. public bool AlignerIsError
  27. {
  28. get;
  29. set;
  30. }
  31. public string ElapseTime
  32. {
  33. get;
  34. set;
  35. }
  36. public int Notch
  37. {
  38. get;
  39. set;
  40. }
  41. public string AlignerStatus
  42. {
  43. get;
  44. set;
  45. }
  46. public ICommand Command
  47. {
  48. get;
  49. private set;
  50. }
  51. private void DoCommand(DependencyObject sender)
  52. {
  53. var command = CommandHelper.GetCommandItem(sender);
  54. var lstParameter = new List<object>(command.Parameters);
  55. lstParameter.Insert(0, command.Target);
  56. lstParameter.Insert(1, command.CommandName);
  57. InvokeClient.Instance.Service.DoOperation(OperationName.DeviceOperation, lstParameter.ToArray());
  58. }
  59. }
  60. }