| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 | 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.Animation;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;namespace Venus_Themes.UserControls{    /// <summary>    /// DEVceA.xaml 的交互逻辑    /// </summary>    public partial class DEVceA : UserControl    {        public DEVceA()        {            InitializeComponent();        }        public static readonly DependencyProperty VCEOutDoorIsOpenProperty = DependencyProperty.Register(            "VCEOutDoorIsOpen", typeof(bool), typeof(DEVceA));        public bool VCEOutDoorIsOpen        {            get => (bool)GetValue(VCEOutDoorIsOpenProperty);            set => SetValue(VCEOutDoorIsOpenProperty, value);        }        public static readonly DependencyProperty IsVentingProperty = DependencyProperty.Register(    "IsVenting", typeof(bool), typeof(DEVceA));        public bool IsVenting        {            get => (bool)GetValue(IsVentingProperty);            set => SetValue(IsVentingProperty, value);        }        public static readonly DependencyProperty VCENameProperty = DependencyProperty.Register("VCEName", typeof(string), typeof(DEVceA));        public string VCEName        {            get => (string)GetValue(VCENameProperty);            set => SetValue(VCENameProperty, value);        }        public static readonly DependencyProperty PressureValueProperty = DependencyProperty.Register(       "PressureValue", typeof(double), typeof(DEVceA));        public double PressureValue        {            get { return (double)this.GetValue(PressureValueProperty); }            set { this.SetValue(PressureValueProperty, value); }        }        public static readonly DependencyProperty PercentValueProperty = DependencyProperty.Register(       "PercentValue", typeof(double), typeof(DEVceA), new PropertyMetadata(0.0, OnDataChanged));        private static void OnDataChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)        {            if (d is DEVceA chamber)            {                DoubleAnimation doubleAnimation = new DoubleAnimation((double)e.OldValue, (double)e.NewValue, new Duration(TimeSpan.FromSeconds(1)));                chamber.rec_Water.BeginAnimation(HeightProperty, doubleAnimation);            }        }        public double PercentValue        {            get { return (double)GetValue(PercentValueProperty); }            set            {                SetValue(PercentValueProperty, value);            }        }        public static readonly DependencyProperty CassetteArriveProperty = DependencyProperty.Register(        "CassetteArrive", typeof(bool), typeof(DEVceA));        public bool CassetteArrive        {            get { return (bool)this.GetValue(CassetteArriveProperty); }            set { this.SetValue(CassetteArriveProperty, value); }        }    }}
 |