How to use EventManager3D in DXEngine
#2
By default the EventManager3D subscribes to mouse events on the Viewport3D control.

The problem with using EventManager3D inside DXEngine is that the Viewport3D control is not actually shown - it is just a placeholder for 3D scene objects. Because it is not show (IsVisible == false), WPF does not send any mouse or touch events to the control.

The code inside EventManager3D can detect when it is running inside DXEngine and in this case subscribes to events on the parent DXViewportView. But if the EventManager3D is created before Viewport3D is added to DXViewportView, then this is not possible.

In this case you need to set the CustomEventsSourceElement property on EventManager3D and specify the FrameworkElement that will be used to subscribe events.

This is also done in the EventManagerDragSample sample that comes with Ab3d.DXEngine - the code here is the following:

Code:
_eventManager = new Ab3d.Utilities.EventManager3D(Viewport3D1);
_eventManager.CustomEventsSourceElement = ViewportBorder;
Andrej Benedik
  


Messages In This Thread
RE: How to use EventManager3D in DXEngine - by abenedik - 05-10-2016, 09:37 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)