8

How can I get a UIElement to ignore mouse clicks on it and pass it through to the control behind it?

I have a 50% transparent UIElement which covers another element. When I attempt to click on the background element, the mouse click is captured by the foreground semi-transparent UIElement.

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
Mark Ingram
  • 71,849
  • 51
  • 176
  • 230
  • Like is required to implement the new "clickjacking" exploit, you mean? – tags2k Oct 08 '08 at 13:35
  • This is the first time I've heard of "clickjacking", but I was more thinking of a selection rectangle. I.e. click on an item to select it, click again to unselect - except when I click the second time, the selection rect swallows the event. – Mark Ingram Oct 08 '08 at 13:37
  • Sorry Mark, it's a brand new exploit and it was far too specific a question to let slip by without flagging up the potential security risks of such an implementation. http://www.theregister.co.uk/2008/10/07/clickjacking_surveillance_zombie/ – tags2k Oct 08 '08 at 13:52
  • Hmm... That is nasty. I think I was change the selection rectangle to just be a selection border. At least then the click will go through to my object without being swallowed. Thanks for the link, the video was very interesting. – Mark Ingram Oct 08 '08 at 14:17

1 Answers1

15

Set IsHitTestVisible=false

Jobi Joy
  • 49,102
  • 20
  • 108
  • 119