VceT1Control.xaml.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System.Windows;
  2. using System.Windows.Controls;
  3. namespace MECF.Framework.UI.Client.ClientControls.VceControls
  4. {
  5. /// <summary>
  6. /// VceT1Control.xaml 的交互逻辑
  7. /// </summary>
  8. public partial class VceT1Control : UserControl
  9. {
  10. public bool IsFoupOn
  11. {
  12. get { return (bool)GetValue(IsFoupOnProperty); }
  13. set { SetValue(IsFoupOnProperty, value); }
  14. }
  15. // Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc...
  16. public static readonly DependencyProperty IsFoupOnProperty =
  17. DependencyProperty.Register("IsFoupOn", typeof(bool), typeof(VceT1Control), new PropertyMetadata(false, IsFoupOnChanged));
  18. public static void IsFoupOnChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
  19. {
  20. if (!(obj is VceT1Control))
  21. return;
  22. VceT1Control ctrl = (VceT1Control)obj;
  23. System.Windows.Visibility visibility = (bool)e.NewValue ? Visibility.Visible : Visibility.Hidden;
  24. if (ctrl.foup.Visibility != visibility)
  25. ctrl.foup.Visibility = visibility;
  26. }
  27. public VceT1Control()
  28. {
  29. InitializeComponent();
  30. foup.Visibility = Visibility.Hidden;
  31. }
  32. }
  33. }