Why are WPF Border borders visible in design mode but not in the application?
The designer shows a black border around the red background, but the actual app only shows the red background. What gives? How do I make the black border visible?
Here's the XAML for that window:
<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>
+3
source to share
3 answers