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 wind开发者_开发问答ows 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?
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 TopMost
to 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 OverlayManager
which allows to add and remove overlays, such as lines.
精彩评论