Kei
Kei

Reputation: 1616

Any way to make WPF Adorner ignore mouse?

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?

Upvotes: 4

Views: 2375

Answers (2)

Thomas Levesque
Thomas Levesque

Reputation: 292555

Set the IsHitTestVisible property of the Adorner to false

Upvotes: 11

Charlie
Charlie

Reputation: 15247

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.

Upvotes: 1

Related Questions