1
我重写边界CornerRadius作为的App.xaml文件默认样式(如下图所示)重写默认风格让我的WPF窗口四舍五入
<Application x:Class="BorderCornerProblem.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="CornerRadius" Value="50"/>
</Style>
</Application.Resources>
</Application>
,并在MainWindow.xaml文件我有
<Window x:Class="BorderCornerProblem.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
</Window>
结果是窗口有一个黑色的圆角。
我的问题,然后是如何定义DefaultStyle与CornerRadius组为边境不会惹我的窗口?
所以你想改变一些边框样式,但不是全部? – ChrisBD 2012-02-13 11:41:47
好吧,是的。我想有一个样式的所有边界我使用**明确**在xaml – 4rchie 2012-02-13 11:50:48