阅读 124

WPF border圆角CornerRadius的绑定

错误写法:

public Thickness Radius
{
get { return (Thickness)GetValue(RadiusProperty); }
set { SetValue(RadiusProperty, value); }
}
public static readonly DependencyProperty RadiusProperty =
DependencyProperty.Register("Radius", typeof(Thickness), typeof(CheckButton), new PropertyMetadata(new Thickness(0)));

正确写法

public string Radius
{
get { return (string)GetValue(RadiusProperty); }
set { SetValue(RadiusProperty, value); }
}
public static readonly DependencyProperty RadiusProperty =
DependencyProperty.Register("Radius", typeof(string), typeof(CheckButton), new PropertyMetadata("0"));

前台border

搞不太懂为什么要用string而不是Thickness

原文:https://www.cnblogs.com/GongJx/p/15213134.html

文章分类
代码人生
版权声明:本站是系统测试站点,无实际运营。本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 XXXXXXo@163.com 举报,一经查实,本站将立刻删除。
相关推荐