I noticed that when overriding the System.Windows.Window OnRender method fails to draw to the screen. I\'m sure there\'s a good reason for this but was unable to find the explan
Actually, the Window paints itself, which among others is a rectangle for the background. Whatever is added in the OnRender is behind the background. Make the Background transparent and one can see what is behind it.
At least that is what I found out when using Button and OnRender. If I draw only within the button, nothing can be seen, because the button is drawn over it. But if the drawing extends beyond the button boundaries, anything outside can be seen.
Here an empty button is drawn over a yellow background. In the OnRender, I draw 2 black lines forming a cross. But only the parts of the line outside the button can be seen.
Very strange behavior of OnRender, indeed !