Aligner.xaml.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. using Aitex.Core.Common;
  2. using Aitex.Core.Util;
  3. using Aitex.Sorter.Common;
  4. using System.Windows;
  5. using System.Windows.Controls;
  6. using System.Windows.Input;
  7. using MECF.Framework.Common.Equipment;
  8. namespace Aitex.Sorter.UI.Controls
  9. {
  10. /// <summary>
  11. /// Aligner.xaml 的交互逻辑
  12. /// </summary>
  13. public partial class Aligner : UserControl
  14. {
  15. public Aligner()
  16. {
  17. InitializeComponent();
  18. root.DataContext = this;
  19. }
  20. public WaferInfo Wafer
  21. {
  22. get { return (WaferInfo)GetValue(WaferProperty); }
  23. set { SetValue(WaferProperty, value); }
  24. }
  25. // Using a DependencyProperty as the backing store for WaferItem. This enables animation, styling, binding, etc...
  26. public static readonly DependencyProperty WaferProperty =
  27. DependencyProperty.Register("Wafer", typeof(WaferInfo), typeof(Aligner), new PropertyMetadata(null));
  28. public ModuleName Station
  29. {
  30. get { return (ModuleName)GetValue(StationProperty); }
  31. set { SetValue(StationProperty, value); }
  32. }
  33. // Using a DependencyProperty as the backing store for Station. This enables animation, styling, binding, etc...
  34. public static readonly DependencyProperty StationProperty =
  35. DependencyProperty.Register("Station", typeof(ModuleName), typeof(Aligner), new PropertyMetadata(ModuleName.Aligner));
  36. public ICommand Command
  37. {
  38. get { return (ICommand)GetValue(CommandProperty); }
  39. set { SetValue(CommandProperty, value); }
  40. }
  41. // Using a DependencyProperty as the backing store for Command. This enables animation, styling, binding, etc...
  42. public static readonly DependencyProperty CommandProperty =
  43. DependencyProperty.Register("Command", typeof(ICommand), typeof(Aligner), new PropertyMetadata(null));
  44. public ICommand WaferTransferCommand
  45. {
  46. get { return (ICommand)GetValue(WaferTransferCommandProperty); }
  47. set { SetValue(WaferTransferCommandProperty, value); }
  48. }
  49. // Using a DependencyProperty as the backing store for WaferMovementCommand. This enables animation, styling, binding, etc...
  50. public static readonly DependencyProperty WaferTransferCommandProperty =
  51. DependencyProperty.Register("WaferTransferCommand", typeof(ICommand), typeof(Aligner), new PropertyMetadata(null));
  52. public ICommand WaferTransferOptionCommand
  53. {
  54. get { return (ICommand)GetValue(WaferTransferOptionCommandProperty); }
  55. set { SetValue(WaferTransferOptionCommandProperty, value); }
  56. }
  57. // Using a DependencyProperty as the backing store for WaferTransferOptionCommand. This enables animation, styling, binding, etc...
  58. public static readonly DependencyProperty WaferTransferOptionCommandProperty =
  59. DependencyProperty.Register("WaferTransferOptionCommand", typeof(ICommand), typeof(Aligner), new PropertyMetadata(null));
  60. public int RotateAngel
  61. {
  62. get { return (int)GetValue(RotateAngelProperty); }
  63. set { SetValue(RotateAngelProperty, value); }
  64. }
  65. // Using a DependencyProperty as the backing store for RotateAngel. This enables animation, styling, binding, etc...
  66. public static readonly DependencyProperty RotateAngelProperty =
  67. DependencyProperty.Register("RotateAngel", typeof(int), typeof(Aligner), new PropertyMetadata(0));
  68. private void MenuItem_Click(object sender, RoutedEventArgs e)
  69. {
  70. var cmd = ((MenuItem)sender).Tag;
  71. Command.Execute(new[] { Station.ToString(), cmd });
  72. }
  73. }
  74. }