BorderElement.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Windows;
  5. using System.Windows.Media;
  6. namespace CyberX8_UI.Themes.Attach
  7. {
  8. public class BorderElement
  9. {
  10. public static readonly DependencyProperty BorderBrushProperty = DependencyProperty.RegisterAttached(
  11. "BorderBrush", typeof(SolidColorBrush), typeof(BorderElement));
  12. public static void SetBorderBrush(DependencyObject element, SolidColorBrush value)
  13. => element.SetValue(BorderBrushProperty, value);
  14. public static SolidColorBrush GetBorderBrush(DependencyObject element)
  15. => (SolidColorBrush)element.GetValue(BorderBrushProperty);
  16. public static readonly DependencyProperty BorderThicknessProperty = DependencyProperty.RegisterAttached(
  17. "BorderThickness", typeof(Thickness), typeof(BorderElement));
  18. public static void SetBorderThickness(DependencyObject element, Thickness value)
  19. => element.SetValue(BorderThicknessProperty, value);
  20. public static Thickness GetBorderThickness(DependencyObject element)
  21. => (Thickness)element.GetValue(BorderThicknessProperty);
  22. public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.RegisterAttached(
  23. "CornerRadius", typeof(CornerRadius), typeof(BorderElement));
  24. public static void SetCornerRadius(DependencyObject element, CornerRadius value)
  25. => element.SetValue(CornerRadiusProperty, value);
  26. public static CornerRadius GetSetCornerRadius(DependencyObject element)
  27. => (CornerRadius)element.GetValue(BorderThicknessProperty);
  28. }
  29. }