SRDFrontView.xaml.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Navigation;
  15. using System.Windows.Shapes;
  16. using OpenSEMI.ClientBase;
  17. using OpenSEMI.Ctrlib.Controls;
  18. using CyberX8_Core;
  19. namespace CyberX8_Themes.UserControls
  20. {
  21. /// <summary>
  22. /// SRDFrontView.xaml 的交互逻辑
  23. /// </summary>
  24. public partial class SRDFrontView : UserControl
  25. {
  26. public SRDFrontView()
  27. {
  28. InitializeComponent();
  29. }
  30. #region UnitData11 (DependencyProperty)
  31. public ModuleInfo UnitData1
  32. {
  33. get { return (ModuleInfo)GetValue(UnitData1Property); }
  34. set { SetValue(UnitData1Property, value); }
  35. }
  36. public static readonly DependencyProperty UnitData1Property =
  37. DependencyProperty.Register("UnitData1", typeof(ModuleInfo), typeof(SRDFrontView), new UIPropertyMetadata(null));
  38. public ModuleInfo UnitData2
  39. {
  40. get { return (ModuleInfo)GetValue(UnitData2Property); }
  41. set { SetValue(UnitData2Property, value); }
  42. }
  43. public static readonly DependencyProperty UnitData2Property =
  44. DependencyProperty.Register("UnitData2", typeof(ModuleInfo), typeof(SRDFrontView), new UIPropertyMetadata(null));
  45. public bool ShowTitle
  46. {
  47. get { return (bool)GetValue(ShowTitleProperty); }
  48. set { SetValue(ShowTitleProperty, value); }
  49. }
  50. public static readonly DependencyProperty ShowTitleProperty =
  51. DependencyProperty.Register("ShowTitle", typeof(bool), typeof(SRDFrontView), new UIPropertyMetadata(true));
  52. public string Title
  53. {
  54. get { return (string)GetValue(TitleProperty); }
  55. set { SetValue(TitleProperty, value); }
  56. }
  57. public static readonly DependencyProperty TitleProperty =
  58. DependencyProperty.Register("Title", typeof(string), typeof(SRDFrontView));
  59. private void Slot_SlotMouseButtonDown(object sender, MouseButtonEventArgs e)
  60. {
  61. GlobalEvents.OnSlotRightClickChanged(sender as Slot);
  62. }
  63. private void Canvas_Drop(object sender, DragEventArgs e)
  64. {
  65. var data = e.Data.GetData(typeof(string));
  66. Button btn = new Button();
  67. btn.Content = data;
  68. canvas.Children.Add(btn);
  69. var point = e.GetPosition(canvas);
  70. Canvas.SetLeft(btn, point.X);
  71. Canvas.SetTop(btn, point.Y);
  72. Debug.WriteLine("Canvas_Drop");
  73. }
  74. #endregion
  75. private void EFEMUpper_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  76. {
  77. var test = sender as Slot;
  78. DragDrop.DoDragDrop(test, "test", DragDropEffects.Copy);
  79. }
  80. private void Slot_WaferTransferStarted(object sender, DragDropEventArgs e)
  81. {
  82. try
  83. {
  84. GlobalEvents.OnSlotWaferTransfer(e);
  85. }
  86. catch (Exception ex)
  87. {
  88. Trace.WriteLine(ex);
  89. }
  90. }
  91. }
  92. }