Activating mouse event in visual object in WPF
I am creating my own control from derived from drawingvisual class and drawn a rectangle. I want to enable mouse events for this object. how can I achiev开发者_StackOverflow社区e this? I thing implementing IInputElement interface might be the solution. Could you guys suggest me how to implement this interface.
Thanks in advance
The DrawingVisual class doesn't offer any mouse events, and according to MSDN the IInputElement
interface is "not intended to be implemented in application or framework-building scenarios."
Maybe you would be better deriving from UserControl
and using DrawingVisual to provide visual content for it?
精彩评论