using System; using System.Windows; using System.Windows.Controls; using System.Windows.Media; namespace Venus_Themes.UserControls { /// /// PendulumValve.xaml 的交互逻辑 /// public partial class PendulumValve : UserControl { public PendulumValve() { InitializeComponent(); } public static readonly DependencyProperty OpeningProperty = DependencyProperty.Register( "Opening", typeof(int), typeof(PendulumValve)); public int Opening { get { return (int)this.GetValue(OpeningProperty); } set { this.SetValue(OpeningProperty, value); } } public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register( "IsOpen", typeof(bool), typeof(PendulumValve),new PropertyMetadata(false,new PropertyChangedCallback(OnPropertyChanged))); static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (Convert.ToBoolean(e.NewValue) == true) { } } public bool IsOpen { get { return (bool)this.GetValue(IsOpenProperty); } set { this.SetValue(IsOpenProperty, value); } } public static readonly DependencyProperty IsOpenColorProperty = DependencyProperty.Register( "IsOpenColor", typeof(SolidColorBrush), typeof(PendulumValve)); public SolidColorBrush IsOpenColor { get { return (SolidColorBrush)this.GetValue(IsOpenColorProperty); } set { this.SetValue(IsOpenColorProperty, value); } } } }