设计器在红色背景周围显示黑色边框,但实际应用中只显示红色背景。是什么赋予了?如何强制黑色边框可见?
这是此窗口的 XAML:
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
MinWidth="400" MinHeight="300"
TextOptions.TextFormattingMode="Display">
<DockPanel Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
<Button DockPanel.Dock="Top" Content="A button"
Padding="8,2" Margin="8" />
<Border DockPanel.Dock="Top" Height="10" BorderBrush="Black"
SnapsToDevicePixels="True" Background="Red" />
<Button DockPanel.Dock="Top" Content="A button"
Padding="8,2" Margin="8" />
</DockPanel>
</Window>