hi,我已经创建了一个依赖项属性,现在我想为其设置默认画笔(当前:透明),但是我想绑定到静态或动态资源。这是我的代码
public static readonly DependencyProperty SideBrushProperty = DependencyProperty.RegisterAttached(
"SideBrush", typeof(Brush), typeof(ImageRadioButton), new FrameworkPropertyMetadata(Brushes.Transparent, FrameworkPropertyMetadataOptions.Inherits));
我该怎么做?
在您的ctor中设置默认值
public ImageRadioButton(){
SideBrush = Brushes.Red;
}