Any way to make WPF Adorner ignore mouse?
Question
Is there any way to make WPF adorner ignore mouse entirely so that the UIElement behind the adorner still gets mouse events as if the adorner does not exist?
Solution
Set the IsHitTestVisible
property of the Adorner
to false
OTHER TIPS
If you use the tunneling version of the mouse events rather than the bubbling events (i.e., PreviewMouseDown
instead of MouseDown
), you will receive the mouse events from the UIElement
first, and be able to stop them from reaching the adorner by setting e.Handled
to true.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow