You can accomplish this using a more sophisticated brush for your border:
<Border BorderThickness="2" Width="200" Height="100"> <Border.BorderBrush> <LinearGradientBrush StartPoint="0,0" EndPoint="0.5,0" SpreadMethod="Reflect"> <GradientStop Color="Blue" Offset="0" /> <GradientStop Color="Blue" Offset="0.02" /> <GradientStop Color="Red" Offset="0.02" /> </LinearGradientBrush> </Border.BorderBrush> </Border>
This is not brilliant and depends on the size of the border and its definition. However, there are other variations of this that may work better using some other types of brushes.
source share