bwp


If I have a custom frameworkelement with an overridden OnRender method, I only get mouse events over the portion of the element that I have actually drawn to. Is there a way to override this behavior and specify the "mouse event" region independently of what has been drawn

I have run into the same issue when I want an invisible element to respond to mouse events. I have been setting the objects opacity to a very low value which does the trick because it doesn't show up and also gets mouse events. But this solution seems like a kludge.



Re: Windows Presentation Foundation (WPF) setting uielement's mouse sensitive region

digitalnetbizz

you can override measureoverride and return a bigger region. that is your bounding box. you can always render something smaller.

another method worth looking at is HitTestCore.





Re: Windows Presentation Foundation (WPF) setting uielement's mouse sensitive region

bwp

Thanks, overriding HitTestCore did the trick!

(documented in
http://msdn2.microsoft.com/en-us/library/ms752097.aspx
at the very end of the page)