ThicknessDialogViewModel.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. using System;
  2. using System.Runtime.InteropServices;
  3. using System.Windows;
  4. using System.Windows.Input;
  5. using Aitex.Core.RT.Log;
  6. using MECF.Framework.Common.DataCenter;
  7. using OpenSEMI.ClientBase;
  8. using OpenSEMI.ClientBase.Command;
  9. namespace VirgoUI.Client.Dialog
  10. {
  11. public class ThicknessDialogViewModel : DialogViewModel<string>
  12. {
  13. private ICommand _SetThickCommand;
  14. public ICommand SetThickCommand
  15. {
  16. get
  17. {
  18. if (this._SetThickCommand == null)
  19. this._SetThickCommand = new BaseCommand<EventCommandParameter<object, RoutedEventArgs>>((EventCommandParameter<object, RoutedEventArgs> arg) => this.OnSetThickCommand(arg));
  20. return this._SetThickCommand;
  21. }
  22. }
  23. private ICommand _SetThinCommand;
  24. public ICommand SetThinCommand
  25. {
  26. get
  27. {
  28. if (this._SetThinCommand == null)
  29. this._SetThinCommand = new BaseCommand<EventCommandParameter<object, RoutedEventArgs>>((EventCommandParameter<object, RoutedEventArgs> arg) => this.OnSetThinCommand(arg));
  30. return this._SetThinCommand;
  31. }
  32. }
  33. private ICommand _BtnCancelCommand;
  34. public ICommand CancelCommand
  35. {
  36. get
  37. {
  38. if (this._BtnCancelCommand == null)
  39. this._BtnCancelCommand = new BaseCommand<EventCommandParameter<object, RoutedEventArgs>>((EventCommandParameter<object, RoutedEventArgs> arg) => this.OnCancelCommand(arg));
  40. return this._BtnCancelCommand;
  41. }
  42. }
  43. private ICommand _BtnIgnoreCommand;
  44. public ICommand IgnoreCommand
  45. {
  46. get
  47. {
  48. if (this._BtnIgnoreCommand == null)
  49. this._BtnIgnoreCommand = new BaseCommand<EventCommandParameter<object, RoutedEventArgs>>((EventCommandParameter<object, RoutedEventArgs> arg) => this.OnIgnoreCommand(arg));
  50. return this._BtnIgnoreCommand;
  51. }
  52. }
  53. protected override void OnInitialize()
  54. {
  55. base.OnInitialize();
  56. }
  57. public ThicknessDialogViewModel( )
  58. {
  59. this.DisplayName = "Wafer Thickness Type Selection";
  60. }
  61. private void OnSetThickCommand(EventCommandParameter<object, RoutedEventArgs> arg)
  62. {
  63. DialogResult = "Thick";
  64. TryClose(true);
  65. }
  66. private void OnSetThinCommand(EventCommandParameter<object, RoutedEventArgs> arg)
  67. {
  68. DialogResult = "Thin";
  69. TryClose(true);
  70. }
  71. private void OnCancelCommand(EventCommandParameter<object, RoutedEventArgs> arg)
  72. {
  73. DialogResult = "";
  74. TryClose(false);
  75. }
  76. private void OnIgnoreCommand(EventCommandParameter<object, RoutedEventArgs> arg)
  77. {
  78. DialogResult = "Ignore";
  79. TryClose(true);
  80. }
  81. }
  82. }