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 { /// /// Vce.xaml 的交互逻辑 /// public partial class Vce : UserControl { public Vce() { InitializeComponent(); } public static readonly DependencyProperty VCEOutDoorIsOpenProperty = DependencyProperty.Register( "VCEOutDoorIsOpen", typeof(bool), typeof(Vce)); public bool VCEOutDoorIsOpen { get => (bool)GetValue(VCEOutDoorIsOpenProperty); set => SetValue(VCEOutDoorIsOpenProperty, value); } public static readonly DependencyProperty IsVentingProperty = DependencyProperty.Register( "IsVenting", typeof(bool), typeof(Vce)); public bool IsVenting { get => (bool)GetValue(IsVentingProperty); set => SetValue(IsVentingProperty, value); } public static readonly DependencyProperty VCENameProperty = DependencyProperty.Register("VCEName", typeof(string), typeof(Vce)); public string VCEName { get => (string)GetValue(VCENameProperty); set => SetValue(VCENameProperty, value); } public static readonly DependencyProperty PressureValueProperty = DependencyProperty.Register( "PressureValue", typeof(double), typeof(Vce)); 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(Vce), new PropertyMetadata(0.0, OnDataChanged)); private static void OnDataChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (d is Vce 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(Vce)); public bool CassetteArrive { get { return (bool)this.GetValue(CassetteArriveProperty); } set { this.SetValue(CassetteArriveProperty, value); } } } }