0
我想绑定CornerRadius值。将CornerRadius绑定到相关属性
CornerRadius="{Binding CornerRadiusInfoBtn}"
这是TitleBar中的代码。
这是我的财产。
public CornerRadius CornerRadiusInfoBtn
{
get { return (CornerRadius)GetValue(CornerRadiusInfoBtnProperty); }
set { SetValue(CornerRadiusInfoBtnProperty, value); }
}
// Using a DependencyProperty as the backing store for CornerRadiusInfoBtn. This enables animation, styling, binding, etc...
public static readonly DependencyProperty CornerRadiusInfoBtnProperty =
DependencyProperty.Register("CornerRadiusInfoBtn", typeof(CornerRadius), typeof(TitleBar), new PropertyMetadata(new CornerRadius(0.0,0.0,2.0,2.0)));
但是那里没有圆角。怎么了?
圆角在哪里?它是否在CornerRadius类中? –
您是否将数据上下文设置为“TitleBar”的实例? – PoweredByOrange
当我设置一个大于0的值时,角落被舍入。 – user3197157