FOUPTopView.xaml.cs 3.7 KB

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