FOUPTopView2.xaml.cs 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using System.Windows;
  2. using System.Windows.Controls;
  3. using System.Windows.Input;
  4. using Aitex.Sorter.Common;
  5. using MECF.Framework.Common.Equipment;
  6. namespace MECF.Framework.UI.Client.ClientControls.UnitControls
  7. {
  8. /// <summary>
  9. /// FOUPTopView.xaml 的交互逻辑
  10. /// </summary>
  11. public partial class FOUPTopView2 : UserControl
  12. {
  13. public FOUPTopView2()
  14. {
  15. InitializeComponent();
  16. root.DataContext = this;
  17. }
  18. public string Label
  19. {
  20. get { return (string)GetValue(LabelProperty); }
  21. set { SetValue(LabelProperty, value); }
  22. }
  23. // Using a DependencyProperty as the backing store for Label. This enables animation, styling, binding, etc...
  24. public static readonly DependencyProperty LabelProperty =
  25. DependencyProperty.Register("Label", typeof(string), typeof(FOUPTopView2), new PropertyMetadata(null));
  26. public ICommand Command
  27. {
  28. get { return (ICommand)GetValue(CommandProperty); }
  29. set { SetValue(CommandProperty, value); }
  30. }
  31. // Using a DependencyProperty as the backing store for Command. This enables animation, styling, binding, etc...
  32. public static readonly DependencyProperty CommandProperty =
  33. DependencyProperty.Register("Command", typeof(ICommand), typeof(FOUPTopView2), new PropertyMetadata(null));
  34. public LoadportCassetteState CassetteState
  35. {
  36. get { return (LoadportCassetteState)GetValue(CassetteStateProperty); }
  37. set { SetValue(CassetteStateProperty, value); }
  38. }
  39. // Using a DependencyProperty as the backing store for Present. This enables animation, styling, binding, etc...
  40. public static readonly DependencyProperty CassetteStateProperty =
  41. DependencyProperty.Register("CassetteState", typeof(LoadportCassetteState), typeof(FOUPTopView2), new FrameworkPropertyMetadata(LoadportCassetteState.Unknown));
  42. public FoupDoorState DoorState
  43. {
  44. get { return (FoupDoorState)GetValue(DoorStateProperty); }
  45. set { SetValue(DoorStateProperty, value); }
  46. }
  47. // Using a DependencyProperty as the backing store for Open. This enables animation, styling, binding, etc...
  48. public static readonly DependencyProperty DoorStateProperty =
  49. DependencyProperty.Register("DoorState", typeof(FoupDoorState), typeof(FOUPTopView2), new FrameworkPropertyMetadata(FoupDoorState.Unknown)); //FrameworkPropertyMetadataOptions.AffectsRender
  50. public ModuleName Station
  51. {
  52. get { return (ModuleName)GetValue(StationProperty); }
  53. set { SetValue(StationProperty, value); }
  54. }
  55. // Using a DependencyProperty as the backing store for Station. This enables animation, styling, binding, etc...
  56. public static readonly DependencyProperty StationProperty =
  57. DependencyProperty.Register("Station", typeof(ModuleName), typeof(FOUPTopView2), new PropertyMetadata(ModuleName.System));
  58. private void MenuItem_Click(object sender, RoutedEventArgs e)
  59. {
  60. var cmd = ((MenuItem)sender).Tag;
  61. Command.Execute(new[] { Station.ToString(), cmd });
  62. }
  63. //protected override void OnRender(DrawingContext drawingContext)
  64. //{
  65. // base.OnRender(drawingContext);
  66. // if (DoorState == FoupDoorState.Open)
  67. // {
  68. // // cassette.VerticalAlignment = VerticalAlignment.Top;
  69. // }
  70. // else if (DoorState == FoupDoorState.Close)
  71. // {
  72. // //cassette.VerticalAlignment = VerticalAlignment.Bottom;
  73. // }
  74. //}
  75. }
  76. }