3

I have a WPF application using multiple independent windows. I would like to draw a line from one of the windows to another one. This needs to be controlled programmatically and if one of the windows is moved, this line needs to be updated accordingly.

What's the best way to do something like this? A transparent window on top of all others?

mbuchetics
  • 1,370
  • 1
  • 17
  • 34
  • 1
    this could inspire you ;-) http://stackoverflow.com/questions/835175/replacing-desktop-wallpaper-draw-on-the-desktop – Davide Piras Sep 19 '11 at 11:25
  • On top of my mind I guess of using, window like `Popups` instead of child `Windows` and a `Adorner` behavior that syncs all of the popups' adoner layers.... wild! – WPF-it Sep 19 '11 at 12:23

1 Answers1

0

Ok, so all in all my solution is pretty simple and works well. I create a regular Window with Background=Transparent, ShowInTaskbar=False and the Size matching the screen (or multiple screens if attached). Additionally, I set TopMostto true. In this OverlayWindow I have a canvas where I can place objects or draw to. To allow other modules and windows of my application to draw overlays, I have a global OverlayManagerwhich allows to add and remove overlays, such as lines.

mbuchetics
  • 1,370
  • 1
  • 17
  • 34