tags:

views:

114

answers:

2

I want to draw the same background on multiple windows for example the background could be concentric circles, a multi colored grid or any mathematical shapes combined. These backgrounds are customizable from an external routine which is in a different module. When i instruct the external routine to change the background all the windows automatically redraws itself. The only problem is each window can have a different size, and these are all vector drawings without any pixelation

What is the best way to achieve this. I am relatively new to WPF and any help will be greatly appreciated.

A: 

I think you can create your own control that inherits from FrameworkElement and override the OnRender method:

protected override void OnRender(DrawingContext drawingContext)

Using the drawingContext you can draw whatever you want :)

Jalfp
A: 

I did look at the drawing context and to supply the drawing routine using a delegate, but I couldn't figure out how to have the drawings resize without having access to the control that's being drawn on.