RobotFrontView.xaml.cs 2.9 KB

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