【发布时间】:2020-06-04 09:23:21
【问题描述】:
我在 xaml 中有以下代码来设置按钮的角半径。如何为应用程序中的所有按钮定义全局样式以具有恒定的角半径?
<Button Content="Exit" MinWidth="65" Background="#b82c2c" Foreground="#fff" BorderThickness="0"
Height="25" VerticalAlignment="Bottom" >
<Button.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</Button.Resources>
</Button>
【问题讨论】:
-
@Clemens 它不适用于 App.xaml 中的边框。注意结构。当我设置 Property="Border" 时,它说成员无法识别或无法访问。
标签: wpf windows xaml desktop-application