Here is a custom control which you can use in place of the Border. It fixes the problem with the BorderBrush property. It uses Rectangles which work as another answer indicates. Please note that this control will probably not match the performance of using the Border control but it does work, so I suggest only using it where necessary.
<Style TargetType="{x:Type controls:BorderFix}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:BorderFix}">
<DockPanel x:Name="PART_Container"
Background="{TemplateBinding Background}"
LastChildFill="True"
UseLayoutRounding="{TemplateBinding UseLayoutRounding}">
<Rectangle x:Name="PART_LeftBorder"
DockPanel.Dock="Left"
Fill="{TemplateBinding BorderBrush}"
Width="{Binding Path=BorderThickness.Left, RelativeSource={RelativeSource TemplatedParent}}"/>
<Rectangle x:Name="PART_TopBorder"
DockPanel.Dock="Top"
Fill="{TemplateBinding BorderBrush}"
Height="{Binding Path=BorderThickness.Top, RelativeSource={RelativeSource TemplatedParent}}"/>
<Rectangle x:Name="PART_RightBorder"
DockPanel.Dock="Right"
Fill="{TemplateBinding BorderBrush}"
Width="{Binding Path=BorderThickness.Right, RelativeSource={RelativeSource TemplatedParent}}"/>
<Rectangle x:Name="PART_BottomBorder"
DockPanel.Dock="Bottom"
Fill="{TemplateBinding BorderBrush}"
Height="{Binding Path=BorderThickness.Bottom, RelativeSource={RelativeSource TemplatedParent}}"/>
<ContentPresenter x:Name="PART_Content"/>
</DockPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
public sealed class BorderFix : ContentControl
{
static BorderFix()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(BorderFix), new FrameworkPropertyMetadata(typeof(BorderFix)));
}
}
The fact that we have to do this is pretty ridiculous. Another answer suggests that this bug is fixed in the version of .NET used by Windows 8. I have not tested that but let us hope that is correct. .NET 4.5.51209 exhibits the same problem.