Shield.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System.Windows;
  2. using System.Windows.Controls.Primitives;
  3. using System.Windows.Markup;
  4. using System.Windows.Media;
  5. namespace HandyControl.Controls;
  6. [ContentProperty(nameof(Status))]
  7. public class Shield : ButtonBase
  8. {
  9. public static readonly DependencyProperty SubjectProperty = DependencyProperty.Register(
  10. nameof(Subject), typeof(string), typeof(Shield), new PropertyMetadata(default(string)));
  11. public string Subject
  12. {
  13. get => (string) GetValue(SubjectProperty);
  14. set => SetValue(SubjectProperty, value);
  15. }
  16. public static readonly DependencyProperty StatusProperty = DependencyProperty.Register(
  17. nameof(Status), typeof(object), typeof(Shield), new PropertyMetadata(default(object)));
  18. public object Status
  19. {
  20. get => GetValue(StatusProperty);
  21. set => SetValue(StatusProperty, value);
  22. }
  23. public static readonly DependencyProperty ColorProperty = DependencyProperty.Register(
  24. nameof(Color), typeof(Brush), typeof(Shield), new PropertyMetadata(default(Brush)));
  25. public Brush Color
  26. {
  27. get => (Brush) GetValue(ColorProperty);
  28. set => SetValue(ColorProperty, value);
  29. }
  30. }