using OpenSEMI.ClientBase; using System.Windows; using System.Windows.Controls; using System.Windows.Input; using static Venus_Core.NiceRobotAction; namespace Venus_Themes.UserControls { /// /// XinSongRobot.xaml 的交互逻辑 /// 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); } } } }