SwitchButton.cs 443 B

12345678910111213141516171819202122232425262728
  1. using System.Windows;
  2. using System.Windows.Controls;
  3. namespace OpenSEMI.Ctrlib.Controls
  4. {
  5. public class SwitchButton : Button
  6. {
  7. public static readonly DependencyProperty ONProperty;
  8. public bool ON
  9. {
  10. get
  11. {
  12. return (bool)GetValue(ONProperty);
  13. }
  14. set
  15. {
  16. SetValue(ONProperty, value);
  17. }
  18. }
  19. static SwitchButton()
  20. {
  21. ONProperty = DependencyProperty.Register("ON", typeof(bool), typeof(SwitchButton));
  22. }
  23. }
  24. }