开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜