【发布时间】:2013-07-12 18:41:05
【问题描述】:
我有以下风格:
<Style x:Key="WhiteStyle" TargetType="{x:Type Label}">
<Setter Property="BorderBrush" Value="White"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
但是,我想添加属性CornerRadius 并修改值。不幸的是,XAML 错误表明 Label 没有 CornerRadius 属性。我的问题,我必须如何修改这个 XAML?
谢谢,
【问题讨论】:
-
您需要将依赖属性附加到现有控件:stackoverflow.com/questions/14318707/…。我建议将此样式应用于
TargetType="{x:Type Border}"并将边框环绕您的标签。
标签: wpf xaml label cornerradius