26 lines
971 B
C#
26 lines
971 B
C#
using System.Windows;
|
|
using MaterialDesignThemes.Wpf;
|
|
|
|
namespace Livia.Views.AttachedProperties;
|
|
|
|
public class IconKindProperties : DependencyObject
|
|
{
|
|
// Register an attached dependency property with the specified
|
|
// property name, property type, owner type, and property metadata.
|
|
public static readonly DependencyProperty IconKindProperty =
|
|
DependencyProperty.RegisterAttached(
|
|
"IconKind",
|
|
typeof(PackIconKind),
|
|
typeof(IconKindProperties),
|
|
new FrameworkPropertyMetadata(PackIconKind.QuestionMark,
|
|
FrameworkPropertyMetadataOptions.AffectsRender)
|
|
);
|
|
|
|
// Declare a get accessor method.
|
|
public static PackIconKind GetIconKind(UIElement target) =>
|
|
(PackIconKind)target.GetValue(IconKindProperty);
|
|
|
|
// Declare a set accessor method.
|
|
public static void SetIconKind(UIElement target, PackIconKind value) =>
|
|
target.SetValue(IconKindProperty, value);
|
|
} |