开发者

WPF handling events overlay object

I have a some grids with a overlay canvas on top. The canvas is transparent and I can only handle mouse events on this canvas.

The problem is that I want to handle mouseDownEvents on the appropriate Grid object instead of the canvas.

I have experimented with routed events and tried to route events deeper in the WPF tree by handling events at the grid that are already handled by the ca开发者_Python百科nvas: grid.AddHandler(Grid.MouseDownEvent, new MouseButtonEventHandler(EducationMouseDown), true);

I also tried to set the Handled property of the eventArgs to false in the handler of the canvas.

Unfortunately, non of these attemps worked.


Try to set IsHitTestVisible="false" on your overlay canvas.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜