| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 | using OpenSEMI.ClientBase;using System.Windows;using System.Windows.Controls;using System.Windows.Input;using static Venus_Core.NiceRobotAction;namespace Venus_Themes.UserControls{        /// <summary>    /// XinSongRobot.xaml 的交互逻辑    /// </summary>    public partial class XinSongRobot : UserControl    {        public XinSongRobot()        {            InitializeComponent();        }        public static readonly DependencyProperty Blade1RobotWaferProperty = DependencyProperty.Register(       "Blade1RobotWafer",       typeof(WaferInfo),       typeof(XinSongRobot));        public WaferInfo Blade1RobotWafer        {            get => (WaferInfo)GetValue(Blade1RobotWaferProperty);            set => SetValue(Blade1RobotWaferProperty, value);        }        public static readonly DependencyProperty Blade2RobotWaferProperty = DependencyProperty.Register(        "Blade2RobotWafer",        typeof(WaferInfo),        typeof(XinSongRobot));        public WaferInfo Blade2RobotWafer        {            get => (WaferInfo)GetValue(Blade2RobotWaferProperty);            set => SetValue(Blade2RobotWaferProperty, value);        }        public static readonly DependencyProperty Blade1RobotXActionProperty = DependencyProperty.Register(           "Blade1RobotXAction",           typeof(NiceXinSongWaferRobotXAction),           typeof(XinSongRobot),           new PropertyMetadata(NiceXinSongWaferRobotXAction.Retract1, Blade1RobotXActionPropertyChangedCallback));        public NiceXinSongWaferRobotXAction Blade1RobotXAction        {            get => (NiceXinSongWaferRobotXAction)GetValue(Blade1RobotXActionProperty);            set => SetValue(Blade1RobotXActionProperty, value);        }        private static void Blade1RobotXActionPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)        {            var control = d as XinSongRobot;            var oldAct = (NiceXinSongWaferRobotXAction)e.OldValue;            var newAct = (NiceXinSongWaferRobotXAction)e.NewValue;            if (oldAct != newAct)            {                VisualStateManager.GoToState(control, newAct.ToString(), true);            }        }        public static readonly DependencyProperty Blade2RobotXActionProperty = DependencyProperty.Register(            "Blade2RobotXAction",            typeof(NiceXinSongWaferRobotXAction),            typeof(XinSongRobot),            new PropertyMetadata(NiceXinSongWaferRobotXAction.Retract2, Blade2RobotXActionPropertyChangedCallback));        public NiceXinSongWaferRobotXAction Blade2RobotXAction        {            get => (NiceXinSongWaferRobotXAction)GetValue(Blade2RobotXActionProperty);            set => SetValue(Blade2RobotXActionProperty, value);        }        private static void Blade2RobotXActionPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)        {            var control = d as XinSongRobot;            var oldAct = (NiceXinSongWaferRobotXAction)e.OldValue;            var newAct = (NiceXinSongWaferRobotXAction)e.NewValue;            if (oldAct != newAct)            {                VisualStateManager.GoToState(control, newAct.ToString(), true);            }        }        //private void Canvas_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)        //{        //    VisualStateManager.GoToState(this, NiceXinSongWaferRobotTAction.LLA.ToString(), true);        //}        public static readonly DependencyProperty Blade1RobotTActionProperty = DependencyProperty.Register(          "BladeRobotTAction",          typeof(NiceXinSongWaferRobotTAction),          typeof(XinSongRobot),          new PropertyMetadata(NiceXinSongWaferRobotTAction.T_Origin, BladeRobotTActionPropertyChangedCallback));        public NiceXinSongWaferRobotTAction BladeRobotTAction        {            get => (NiceXinSongWaferRobotTAction)GetValue(Blade1RobotTActionProperty);            set => SetValue(Blade1RobotTActionProperty, value);        }        private static void BladeRobotTActionPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)        {            var control = d as XinSongRobot;            var oldAct = (NiceXinSongWaferRobotTAction)e.OldValue;            var newAct = (NiceXinSongWaferRobotTAction)e.NewValue;            if (oldAct != newAct)            {                VisualStateManager.GoToState(control, newAct.ToString(), true);            }        }          }}
 |