2024年3月23日发(作者:)

public Brush MouseOverBorderbrush

{

get { return (Brush)GetValue(MouseOverBorderbrushProperty); }

set { SetValue(MouseOverBorderbrushProperty, value); }

}

public static readonly DependencyProperty MouseOverBorderbrushProperty =

er("MouseOverBorderbrush", typeof(Brush), typeof(ButtonEx), new PropertyMetadata());

public Brush MouseOverBackground

{

get { return (Brush)GetValue(MouseOverBackgroundProperty); }

set { SetValue(MouseOverBackgroundProperty, value); }

}

public static readonly DependencyProperty MouseOverBackgroundProperty =

er("MouseOverBackground", typeof(Brush), typeof(ButtonEx), new PropertyMetadata());

public Brush MousePressedBackground

{

get { return (Brush)GetValue(MousePressedBackgroundProperty); }

set { SetValue(MousePressedBackgroundProperty, value); }

}

public static readonly DependencyProperty MousePressedBackgroundProperty =

er("MousePressedBackground", typeof(Brush), typeof(ButtonEx), new PropertyMetadata());

}

public enum ButtonType

{

Normal,

Icon,

Text,

IconText

}

为不同类型按钮设置样式,代码如下: