1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace XXX.ToolsExtensions
{
public class CustomButton : Button
{
private static readonly DependencyProperty HoverBackgroundProperty = DependencyProperty.Register(nameof(HoverBackground), typeof(Brush), typeof(CustomButton), new PropertyMetadata(new SolidColorBrush(Colors.Transparent)));
public Brush HoverBackground
{
get { return (Brush)GetValue(HoverBackgroundProperty); }
set { SetValue(HoverBackgroundProperty, value); }
}
private static readonly DependencyProperty PressBackgroundProperty = DependencyProperty.Register(nameof(PressBackground), typeof(Brush), typeof(CustomButton), new PropertyMetadata(new SolidColorBrush(Colors.Transparent)));
public Brush PressBackground
{
get { return (Brush)GetValue(PressBackgroundProperty); }
set { SetValue(PressBackgroundProperty, value); }
}
public static readonly DependencyProperty BorderColorProperty = DependencyProperty.Register("BorderColor", typeof(Brush), typeof(CustomButton), new PropertyMetadata(new SolidColorBrush(Colors.Transparent)));
public Brush BorderColor
{
get { return (Brush)GetValue(BorderColorProperty); }
set { SetValue(BorderColorProperty, value); }
}
public static readonly DependencyProperty StrokeThicknessProperty = DependencyProperty.Register("StrokeThickness", typeof(double), typeof(CustomButton), new UIPropertyMetadata(double.NaN));
public double StrokeThickness
{
get { return (double)GetValue(StrokeThicknessProperty); }
set { SetValue(StrokeThicknessProperty, value); }
}
}
} |
Partager