views:

119

answers:

2

I have a class which inherits from Canvas. On the OnRender method I draw a text which is being covered by the controls that are on the canvas.

Is there a method to place the text "above" the controls? is there an OnRenderComplete method (that is being called after the visual tree was rendered)?

A: 

No, at least nothing that will work properly. Even if you manage to draw on top of the controls when the canvas is rendered, you are still only drawing on the screen where the controls are, the controls have no notion of being drawn over.

If some controls are updates separately, they will not signal the canvas to draw on top of them when they are done drawing themselves.

Guffa
It is sad but true..
Eden
+1  A: 

Try to use DrawingVisual:

http://www.codeproject.com/KB/WPF/WPF_DrawTools.aspx

DrawingCanvas class used in this sample contains DrawingVisual objects, it can be transparent and placed over all ather controls. In this case DrawingVisual can draw text which will appear on another controls. Mouse events should be redirected to underlying controls. I hope that there is more simple solution, but if not, you can try.

Alex Farber