I've created the simplest possible WPF control - It just overrides OnRender and draws a red rectangle.
However ONLY when setting the Background in XAML to Blue, the control is all blue with no red showing. If Background is not set, the red rectangle shows no problem.
How come the red rectangle is not displayed over the blue background when the background is set?
public class MyWpfControl : Control
{
protected override void OnRender(DrawingContext drawingContext)
{
drawingContext.DrawRectangle(Brushes.Red, null, new Rect(0, 0, 100, 100));
}
}