add resharper and hover effect for modules; change navigation bar
This commit is contained in:
@@ -4,22 +4,30 @@ using System.Text;
|
||||
using System.Windows;
|
||||
|
||||
namespace Server_Dashboard {
|
||||
|
||||
/// <summary>
|
||||
/// Attached property base class
|
||||
/// </summary>
|
||||
/// <typeparam name="Parent"></typeparam>
|
||||
/// <typeparam name="Property"></typeparam>
|
||||
public abstract class BaseAttachedProperty<Parent, Property>
|
||||
where Parent : BaseAttachedProperty<Parent, Property>, new() {
|
||||
/// <typeparam name="TParent"></typeparam>
|
||||
/// <typeparam name="TProperty"></typeparam>
|
||||
public abstract class BaseAttachedProperty<TParent, TProperty>
|
||||
where TParent : BaseAttachedProperty<TParent, TProperty>, new() {
|
||||
|
||||
public event Action<DependencyObject, DependencyPropertyChangedEventArgs> ValueChanged = (sender, e) => { };
|
||||
public static Parent Instance { get; private set; } = new Parent();
|
||||
public static readonly DependencyProperty ValueProperty = DependencyProperty.RegisterAttached("Value", typeof(Property), typeof(BaseAttachedProperty<Parent, Property>), new PropertyMetadata(new PropertyChangedCallback(OnValuePropertyChanged)));
|
||||
|
||||
public static TParent Instance { get; private set; } = new TParent();
|
||||
public static readonly DependencyProperty ValueProperty = DependencyProperty.RegisterAttached("Value", typeof(TProperty), typeof(BaseAttachedProperty<TParent, TProperty>), new PropertyMetadata(new PropertyChangedCallback(OnValuePropertyChanged)));
|
||||
|
||||
private static void OnValuePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {
|
||||
Instance.OnValueChanged(d, e);
|
||||
Instance.ValueChanged(d, e);
|
||||
}
|
||||
public static Property GetValue(DependencyObject d) => (Property)d.GetValue(ValueProperty);
|
||||
public static void SetValue(DependencyObject d, Property value) => d.SetValue(ValueProperty, value);
|
||||
public virtual void OnValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { }
|
||||
|
||||
public static TProperty GetValue(DependencyObject d) => (TProperty)d.GetValue(ValueProperty);
|
||||
|
||||
public static void SetValue(DependencyObject d, TProperty value) => d.SetValue(ValueProperty, value);
|
||||
|
||||
public virtual void OnValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user