Refers to Eyeshot 10.0.991 and greater.
Many of you discovered that the Eyeshot native WPF control is not as fast as the Windows Forms one. Basically we all need to blame Microsoft and their D3DImage WPF control implementation. The main reason behind this issue, is the number of additional passes that D3DImage control needs to do to allow composition with the rest of the WPF elements.
A more technical discussion can be found on threads below:
- WPFHost sample flickering on window resize
- Direct3D11 performances
- WPF control issues
- Need SharpDXElement alternative. Workaround to SharpDX WPF flickering.
Today, we can offer a workaround to push WPF control frame rate to the limit: Immediate Mode rendering. It can be controlled using the following property (available only in Eyeshot WPF control):
ViewportLayout.Renderer = rendererType.OpenGL;
ViewportLayout.Renderer = rendererType.Direct3D;
Clearly, with WPF immediate mode, you will not be able to combine (overlap or blend) the Eyeshot control with any other WPF control of your application.
- Drag & drop
- Dock & undock
- Context Menu
- Custom mouse cursors
- GridSplitter (see CopyAndPaste sample)
- Missing "Preview" native mouse events (e.g. PreviewMouseDown)
Listed below are some tricks to make your code work also with the Immediate mode rendering.
if (e.LeftButton == MouseButtonState.Pressed && e.ClickCount == 2)
if (e.ChangedButton == System.Windows.Input.MouseButton.Left && viewportLayout.GetMouseClicks(e) == 2)