ButtonAssist.cs 1.3 KB

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