44 lines
1.4 KiB
C#
44 lines
1.4 KiB
C#
|
|
using System.Windows;
|
|||
|
|
using System.Windows.Media;
|
|||
|
|
|
|||
|
|
namespace MSDevTool.Attached
|
|||
|
|
{
|
|||
|
|
public class ObjectType
|
|||
|
|
{
|
|||
|
|
public static bool GetIsMatchObject(DependencyObject obj)
|
|||
|
|
{
|
|||
|
|
return (bool)obj.GetValue(IsMatchObjectProperty);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public static void SetIsMatchObject(DependencyObject obj, bool value)
|
|||
|
|
{
|
|||
|
|
obj.SetValue(IsMatchObjectProperty, value);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// Using a DependencyProperty as the backing store for MatchObject. This enables animation, styling, binding, etc...
|
|||
|
|
public static readonly DependencyProperty IsMatchObjectProperty =
|
|||
|
|
DependencyProperty.RegisterAttached("IsMatchObject", typeof(bool), typeof(ObjectType), new PropertyMetadata(false));
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
public static SolidColorBrush GetMatchColor(DependencyObject obj)
|
|||
|
|
{
|
|||
|
|
return (SolidColorBrush)obj.GetValue(MatchColorProperty);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public static void SetMatchColor(DependencyObject obj, int value)
|
|||
|
|
{
|
|||
|
|
obj.SetValue(MatchColorProperty, value);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc...
|
|||
|
|
public static readonly DependencyProperty MatchColorProperty =
|
|||
|
|
DependencyProperty.RegisterAttached("MatchColor", typeof(SolidColorBrush), typeof(ObjectType), new PropertyMetadata(null));
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|