Perhaps you could do this, although I donβt know exactly what you want to do with the adorner layer. My solution will let adorner follow the mouse while the window has focus. Please share your ultimate goal so that I can better help you.
My idea would be to create a full-screen borderless window with a transparent background to store any controls you want. The opaque part of your window will be inside the grid.
Create a new window. Set WindowBorderStyle to None, Width, and Height in Auto and Window - Maximum. (I am not looking at the IDE at the moment, so property names may be slightly disabled.)
Copy the XAML code for the grid (or any other main container that you use) into the original window and paste it into a new window. Make sure you replace the empty grid in the new window with the grid you are inserting.
This should allow you to have the adorner layer follow the mouse throughout the window.
Again, set your exact goal here so that I can give an answer that is more suitable for your specific needs.
CodeMouse92
source share