开发者

Keyboard.KeyDown events on ModelVisual3D

开发者 https://www.devze.com 2023-01-31 05:51 出处:网络
I have a visual tree with UIElement3D objects that get focus and fire keyboard events. I would like to catch them at their parent level which is of type ModelVisual3D. However WPF does not allow me to

I have a visual tree with UIElement3D objects that get focus and fire keyboard events. I would like to catch them at their parent level which is of type ModelVisual3D. However WPF does not allow me to subscribe for Keyboard.KeyDown events on ModelVisual3D (it throws an exception at runtime).

The开发者_StackOverflow environment (shell) which this 'parent' lives in does not know anything about its children, which means it does not know anything about the events they will be expecting. So it cannot subscribe for this event and call a method on the relevant child.

Does anybody have an elegant solution for this problem?

Alex.


I solved it. Changed the parent to be ContentUIElement3D and the problem was solved.

0

精彩评论

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