livia-test/Livia/Views/AttachedProperties/SolidColorBrushProperties.cs
2025-03-28 14:31:53 +08:00

64 lines
2.8 KiB
C#

using System.Windows;
using System.Windows.Media;
namespace Livia.Views.AttachedProperties;
public class SolidColorBrushProperties : DependencyObject
{
// Register an attached dependency property with the specified
// property name, property type, owner type, and property metadata.
public static readonly DependencyProperty SolidColorBrush1Property =
DependencyProperty.RegisterAttached(
"SolidColorBrush1",
typeof(SolidColorBrush),
typeof(SolidColorBrushProperties),
new FrameworkPropertyMetadata(new SolidColorBrush(Colors.Transparent),
FrameworkPropertyMetadataOptions.AffectsRender)
);
// Declare a get accessor method.
public static SolidColorBrush GetSolidColorBrush1(UIElement target) =>
(SolidColorBrush)target.GetValue(SolidColorBrush1Property);
// Declare a set accessor method.
public static void SetSolidColorBrush1(UIElement target, SolidColorBrush value) =>
target.SetValue(SolidColorBrush1Property, value);
// Register an attached dependency property with the specified
// property name, property type, owner type, and property metadata.
public static readonly DependencyProperty SolidColorBrush2Property =
DependencyProperty.RegisterAttached(
"SolidColorBrush2",
typeof(SolidColorBrush),
typeof(SolidColorBrushProperties),
new FrameworkPropertyMetadata(new SolidColorBrush(Colors.Transparent),
FrameworkPropertyMetadataOptions.AffectsRender)
);
// Declare a get accessor method.
public static SolidColorBrush GetSolidColorBrush2(UIElement target) =>
(SolidColorBrush)target.GetValue(SolidColorBrush2Property);
// Declare a set accessor method.
public static void SetSolidColorBrush2(UIElement target, SolidColorBrush value) =>
target.SetValue(SolidColorBrush2Property, value);
// Register an attached dependency property with the specified
// property name, property type, owner type, and property metadata.
public static readonly DependencyProperty SolidColorBrush3Property =
DependencyProperty.RegisterAttached(
"SolidColorBrush3",
typeof(SolidColorBrush),
typeof(SolidColorBrushProperties),
new FrameworkPropertyMetadata(new SolidColorBrush(Colors.Transparent),
FrameworkPropertyMetadataOptions.AffectsRender)
);
// Declare a get accessor method.
public static SolidColorBrush GetSolidColorBrush3(UIElement target) =>
(SolidColorBrush)target.GetValue(SolidColorBrush3Property);
// Declare a set accessor method.
public static void SetSolidColorBrush3(UIElement target, SolidColorBrush value) =>
target.SetValue(SolidColorBrush3Property, value);
}