4
我有以下樣式:WPF標籤樣式
<Style x:Key="WhiteStyle" TargetType="{x:Type Label}">
<Setter Property="BorderBrush" Value="White"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
不過,我想補充的財產CornerRadius
和修改值。不幸的是,XAML錯誤說Label
沒有CornerRadius
屬性。我的問題,我該如何修改這個XAML?
感謝,
您將需要一個依賴屬性附加到現有的控制:HTTP:/ /stackoverflow.com/questions/14318707/add-dependency-property-to-existing-net-class。我建議將此樣式應用於'TargetType =「{x:Type Border}」'並將標籤邊框包裹起來。 – Dom