123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- using OpenSEMI.ClientBase;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Input;
- using Venus_Themes.CustomControls;
- using static Venus_Core.NiceRobotAction;
- namespace Venus_Themes.UserControls
- {
- /// <summary>
- /// GuangChuanRobot.xaml 的交互逻辑
- /// </summary>
- public partial class GuangChuanRobot : UserControl
- {
- public GuangChuanRobot()
- {
- InitializeComponent();
- }
- public static readonly DependencyProperty Blade1RobotWaferProperty = DependencyProperty.Register(
- "Blade1RobotWafer",
- typeof(WaferInfo),
- typeof(GuangChuanRobot));
- public WaferInfo Blade1RobotWafer
- {
- get => (WaferInfo)GetValue(Blade1RobotWaferProperty);
- set => SetValue(Blade1RobotWaferProperty, value);
- }
- public static readonly DependencyProperty Blade2RobotWaferProperty = DependencyProperty.Register(
- "Blade2RobotWafer",
- typeof(WaferInfo),
- typeof(GuangChuanRobot));
- public WaferInfo Blade2RobotWafer
- {
- get => (WaferInfo)GetValue(Blade2RobotWaferProperty);
- set => SetValue(Blade2RobotWaferProperty, value);
- }
- public static readonly DependencyProperty Blade1RobotXActionProperty = DependencyProperty.Register(
- "Blade1RobotXAction",
- typeof(NiceGuangChuanWaferRobotXAction),
- typeof(GuangChuanRobot),
- new PropertyMetadata(NiceGuangChuanWaferRobotXAction.Retract1, Blade1RobotXActionPropertyChangedCallback));
- public NiceGuangChuanWaferRobotXAction Blade1RobotXAction
- {
- get => (NiceGuangChuanWaferRobotXAction)GetValue(Blade1RobotXActionProperty);
- set => SetValue(Blade1RobotXActionProperty, value);
- }
- private static void Blade1RobotXActionPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- var control = d as GuangChuanRobot;
- var oldAct = (NiceGuangChuanWaferRobotXAction)e.OldValue;
- var newAct = (NiceGuangChuanWaferRobotXAction)e.NewValue;
- if (oldAct != newAct)
- {
- VisualStateManager.GoToState(control, newAct.ToString(), true);
- }
- }
- public override void OnApplyTemplate()
- {
- base.OnApplyTemplate();
- VisualStateManager.GoToState(this, NiceGuangChuanWaferRobotXAction.Retract1.ToString(), true);
- VisualStateManager.GoToState(this, NiceGuangChuanWaferRobotXAction.Retract2.ToString(), true);
- }
- public static readonly DependencyProperty Blade2RobotXActionProperty = DependencyProperty.Register(
- "Blade2RobotXAction",
- typeof(NiceGuangChuanWaferRobotXAction),
- typeof(GuangChuanRobot),
- new PropertyMetadata(NiceGuangChuanWaferRobotXAction.Retract2, Blade2RobotXActionPropertyChangedCallback));
- public NiceGuangChuanWaferRobotXAction Blade2RobotXAction
- {
- get => (NiceGuangChuanWaferRobotXAction)GetValue(Blade2RobotXActionProperty);
- set => SetValue(Blade2RobotXActionProperty, value);
- }
- private static void Blade2RobotXActionPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- var control = d as GuangChuanRobot;
- var oldAct = (NiceGuangChuanWaferRobotXAction)e.OldValue;
- var newAct = (NiceGuangChuanWaferRobotXAction)e.NewValue;
- if (oldAct != newAct)
- {
- VisualStateManager.GoToState(control, newAct.ToString(), true);
- }
- }
-
- public static readonly DependencyProperty BladeRobotTActionProperty = DependencyProperty.Register(
- "BladeRobotTAction",
- typeof(NiceGuangChuanWaferRobotTAction),
- typeof(GuangChuanRobot),
- new PropertyMetadata(NiceGuangChuanWaferRobotTAction.T_Origin, BladeRobotTActionPropertyChangedCallback));
- public NiceGuangChuanWaferRobotTAction BladeRobotTAction
- {
- get => (NiceGuangChuanWaferRobotTAction)GetValue(BladeRobotTActionProperty);
- set => SetValue(BladeRobotTActionProperty, value);
- }
- private static void BladeRobotTActionPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- var control = d as GuangChuanRobot;
- var oldAct = (NiceGuangChuanWaferRobotTAction)e.OldValue;
- var newAct = (NiceGuangChuanWaferRobotTAction)e.NewValue;
- if (oldAct != newAct)
- {
- VisualStateManager.GoToState(control, newAct.ToString(), true);
- }
- }
- //public static readonly DependencyProperty Blade2RobotTActionProperty = DependencyProperty.Register(
- // "Blade2RobotTAction",
- // typeof(NiceGuangChuanWaferRobotTAction),
- // typeof(GuangChuanRobot),
- // new PropertyMetadata(NiceGuangChuanWaferRobotTAction.T_Origin, Blade2RobotTActionPropertyChangedCallback));
- //public NiceGuangChuanWaferRobotTAction Blade2RobotTAction
- //{
- // get => (NiceGuangChuanWaferRobotTAction)GetValue(Blade2RobotTActionProperty);
- // set => SetValue(Blade2RobotTActionProperty, value);
- //}
- //private static void Blade2RobotTActionPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
- //{
- // var control = d as GuangChuanRobot;
- // var oldAct = (NiceGuangChuanWaferRobotTAction)e.OldValue;
- // var newAct = (NiceGuangChuanWaferRobotTAction)e.NewValue;
- // if (oldAct != newAct)
- // {
- // VisualStateManager.GoToState(control, newAct.ToString(), true);
- // }
- //}
- }
- }
|