ButtonAssist.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System.Windows.Media;
  2. namespace HistoryView.Resources.Styles;
  3. public static class ButtonAssist
  4. {
  5. public static Brush GetButtonHoverBrush(DependencyObject obj)
  6. {
  7. return (Brush)obj.GetValue(ButtonHoverBrushProperty);
  8. }
  9. public static void SetButtonHoverBrush(DependencyObject obj, Brush value)
  10. {
  11. obj.SetValue(ButtonHoverBrushProperty, value);
  12. }
  13. // Using a DependencyProperty as the backing store for ButtonHoverBrush. This enables animation, styling, binding, etc...
  14. public static readonly DependencyProperty ButtonHoverBrushProperty =
  15. DependencyProperty.RegisterAttached("ButtonHoverBrush", typeof(Brush), typeof(ButtonAssist), new PropertyMetadata(default));
  16. public static Brush GetButtonClickBrush(DependencyObject obj)
  17. {
  18. return (Brush)obj.GetValue(ButtonClickBrushProperty);
  19. }
  20. public static void SetButtonClickBrush(DependencyObject obj, Brush value)
  21. {
  22. obj.SetValue(ButtonClickBrushProperty, value);
  23. }
  24. // Using a DependencyProperty as the backing store for ButtonClickBrush. This enables animation, styling, binding, etc...
  25. public static readonly DependencyProperty ButtonClickBrushProperty =
  26. DependencyProperty.RegisterAttached("ButtonClickBrush", typeof(Brush), typeof(ButtonAssist), new PropertyMetadata(default));
  27. }