| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 | using OpenSEMI.ClientBase;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;using static CyberX8_Themes.UserControls.PufControl;namespace CyberX8_Themes.UserControls{        /// <summary>    /// LoaderControl.xaml 的交互逻辑    /// </summary>    public partial class LoaderControl : UserControl    {        public enum LoaderRotation        {            TrnpA = 0,            TrnpB = 1,            Load = 2,            Camera = 3,            ServiceB = 4        }        public LoaderControl()        {            InitializeComponent();        }        public static readonly DependencyProperty WaferVisibleAProperty = DependencyProperty.Register("WaferVisibleA", typeof(bool), typeof(LoaderControl));        public bool WaferVisibleA        {            get { return (bool)this.GetValue(WaferVisibleAProperty); }            set { this.SetValue(WaferVisibleAProperty, value); }        }        public static readonly DependencyProperty WaferVisibleBProperty = DependencyProperty.Register("WaferVisibleB", typeof(bool), typeof(LoaderControl));        public bool WaferVisibleB        {            get { return (bool)this.GetValue(WaferVisibleBProperty); }            set { this.SetValue(WaferVisibleBProperty, value); }        }        public static readonly DependencyProperty LoaderWaferAProperty = DependencyProperty.Register("LoaderWaferA", typeof(WaferInfo), typeof(LoaderControl));        public WaferInfo LoaderWaferA        {            get => (WaferInfo)GetValue(LoaderWaferAProperty);            set => SetValue(LoaderWaferAProperty, value);        }        public static readonly DependencyProperty LoaderWaferBProperty = DependencyProperty.Register("LoaderWaferB", typeof(WaferInfo), typeof(LoaderControl));        public WaferInfo LoaderWaferB        {            get => (WaferInfo)GetValue(LoaderWaferBProperty);            set => SetValue(LoaderWaferBProperty, value);        }        /// <summary>        /// Load Rotation位置        /// </summary>        public static readonly DependencyProperty CurrentRotationProperty = DependencyProperty.Register("CurrentRotation", typeof(LoaderRotation), typeof(LoaderControl),            new PropertyMetadata(LoaderRotation.TrnpA, RotationChangedCallback));        public LoaderRotation CurrentRotation        {            get { return (LoaderRotation)this.GetValue(CurrentRotationProperty); }            set            {                this.SetValue(CurrentRotationProperty, value);            }        }        //Looader Rotation动画触发        private static void RotationChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)        {            var newAct = (LoaderRotation)e.NewValue;            var control = d as LoaderControl;            GoToRotation(control, newAct);        }        private static void GoToRotation(Control control, LoaderRotation rotation)        {            VisualStateManager.GoToElementState(control, rotation.ToString(), false);        }    }}
 |