LED.xaml.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Windows;
  2. using System.Windows.Controls;
  3. namespace Aitex.Sorter.UI.Controls.Common
  4. {
  5. /// <summary>
  6. /// LED.xaml 的交互逻辑
  7. /// </summary>
  8. public partial class LED : UserControl
  9. {
  10. public LED()
  11. {
  12. InitializeComponent();
  13. root.DataContext = this;
  14. }
  15. public bool On
  16. {
  17. get { return (bool)GetValue(OnProperty); }
  18. set { SetValue(OnProperty, value); }
  19. }
  20. // Using a DependencyProperty as the backing store for On. This enables animation, styling, binding, etc...
  21. public static readonly DependencyProperty OnProperty =
  22. DependencyProperty.Register("On", typeof(bool), typeof(LED), new PropertyMetadata(false));
  23. public bool IsRed
  24. {
  25. get { return (bool)GetValue(IsRedProperty); }
  26. set { SetValue(IsRedProperty, value); }
  27. }
  28. // Using a DependencyProperty as the backing store for IsRed. This enables animation, styling, binding, etc...
  29. public static readonly DependencyProperty IsRedProperty =
  30. DependencyProperty.Register("IsRed", typeof(bool), typeof(LED), new PropertyMetadata(false));
  31. }
  32. }