我正在为图像路径编写依赖属性 它显示参数异常默认值类型与属性类型
不匹配[Description("Set image path for button "), Category("Common Properties")]
public ImageSource ImagePath
{
get { return (ImageSource)GetValue(ImagePathProperty); }
set { SetValue(ImagePathProperty, value); }
}
// Using a DependencyProperty as the backing store for ImagePath. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ImagePathProperty =
DependencyProperty.Register("ImagePath", typeof(ImageSource),
typeof(TaskButton), new UIPropertyMetadata(default(ImageSource)));
任何人都可以建议在这个对象的参数中写一些新的UIPropertyMetadata(_argument)