Label自定义控件
public class HighlightLabel : Label
{
/// <summary>
/// 高亮画笔
/// </summary>
public static DependencyProperty HighlightForegroundProperty =
DependencyProperty.Register("HighlightForeground", typeof(Brush), typeof(HighlightLabel), new PropertyMetadata(new SolidColorBrush(Colors.Red), new PropertyChangedCallback(OnHighlightForegroundChanged)));
/// <summary>
/// 高亮画笔
/// </summary>
public Brush HighlightForeground
{
get
{
return (Brush)GetValue(HighlightForegroundProperty);
}
set
{
SetValue(HighlightForegroundProperty, value);
}
}
/// <summary>
/// HighlightForegroundProperty 属性改变时,执行的方法
/// </summary>
/// <param name="sender"></param