| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 | using OpenSEMI.Ctrlib.Controls;using System.Windows;using System.Windows.Controls;using Venus_Themes.Unity;using static Venus_Themes.UserControls.EFEM;namespace Venus_Themes.UserControls{    /// <summary>    /// Chamber.xaml 的交互逻辑    /// </summary>    public partial class ChamberWithHeater : UserControl    {        public ChamberWithHeater()        {            InitializeComponent();        }        public static readonly DependencyProperty IsOpenSlitDoorProperty = DependencyProperty.Register(           "IsOpenSlitDoor", typeof(bool), typeof(ChamberWithHeater));        public bool IsOpenSlitDoor        {            get { return (bool)this.GetValue(IsOpenSlitDoorProperty); }            set { this.SetValue(IsOpenSlitDoorProperty, value); }        }            public static readonly DependencyProperty IsHasWaferProperty = DependencyProperty.Register(          "IsHasWafer", typeof(bool), typeof(ChamberWithHeater),          new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));        public bool IsHasWafer        {            get { return (bool)this.GetValue(IsHasWaferProperty); }            set { this.SetValue(IsHasWaferProperty, value); }        }        public static readonly DependencyProperty IsLidOpenProperty = DependencyProperty.Register(         "IsLidOpen", typeof(bool), typeof(ChamberWithHeater));        public bool IsLidOpen        {            get { return (bool)this.GetValue(IsLidOpenProperty); }            set { this.SetValue(IsLidOpenProperty, value); }        }        public static readonly DependencyProperty IsSRFOnProperty = DependencyProperty.Register(        "IsSRFOn", typeof(bool), typeof(ChamberWithHeater),        new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));        public bool IsSRFOn        {            get { return (bool)this.GetValue(IsSRFOnProperty); }            set { this.SetValue(IsSRFOnProperty, value); }        }        public static readonly DependencyProperty IsBRFOnProperty = DependencyProperty.Register(       "IsBRFOn", typeof(bool), typeof(ChamberWithHeater),       new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));        public bool IsBRFOn        {            get { return (bool)this.GetValue(IsBRFOnProperty); }            set { this.SetValue(IsBRFOnProperty, value); }        }        public static readonly DependencyProperty WaferIDProperty = DependencyProperty.Register(          "WaferID", typeof(string), typeof(ChamberWithHeater));        public string WaferID        {            get { return (string)this.GetValue(WaferIDProperty); }            set { this.SetValue(WaferIDProperty, value); }        }        public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register(      "ModuleName", typeof(string), typeof(ChamberWithHeater));        public string ModuleName        {            get { return (string)this.GetValue(ModuleNameProperty); }            set            {                this.SetValue(ModuleNameProperty, value);            }        }        public static readonly DependencyProperty HeaterPositionProperty = DependencyProperty.Register(          "HeaterPosition", typeof(string), typeof(ChamberWithHeater), new PropertyMetadata("Position1", PositionChangedCallback));        public string HeaterPosition        {            get { return (string)this.GetValue(HeaterPositionProperty); }            set { this.SetValue(HeaterPositionProperty, value); }        }        private void CreateWafer_Click(object sender, RoutedEventArgs e)        {            UIEvents.OnChamberCreateDeleteWafer(new WaferOperation() { ModuleName = ModuleName, IsCreate = true });        }        private void DeleteWafer_Click(object sender, RoutedEventArgs e)        {            UIEvents.OnChamberCreateDeleteWafer(new WaferOperation() { ModuleName = ModuleName, IsCreate = false });        }        private void OpenDoor_Click(object sender, RoutedEventArgs e)        {            //var t = ((((this.Parent as Canvas).Parent as Canvas).Parent as UserControl).DataContext).;            UIEvents.OnPMDoorRaiseChanged(new DoorPara() { ModuleName = ModuleName, IsOpen = "Open" });        }        private void CloseDoor_Click(object sender, RoutedEventArgs e)        {            UIEvents.OnPMDoorRaiseChanged(new DoorPara() { ModuleName = ModuleName, IsOpen = "Close" });        }        private static void PositionChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)        {            var newAct = e.NewValue.ToString();            var control = d as ChamberWithHeater;            if (newAct == "Position1")            {                control.border1.Margin=new Thickness(0, -14, 0, 0);            }            else            {                 control.border1.Margin=new Thickness(0, -10, 0, 0);            }            GoToPosition(control, newAct);        }        private static void GoToPosition(Control control, string robotPosition)        {            VisualStateManager.GoToElementState(control, robotPosition, true);        }    }}
 |