Search code examples
c#wpfopengldevexpressopentk

OpenGL control overlays WPF elements


I have rich client application developed in WPF using DevExpress controls library.

In one of the panels I render some visual elements using OpenTK (OpenGL's wrapper library for .net).

The problem is, OpenGL rendering surface seems to be Top Most within the application. So if I move one panel on to another, OpenGL's control overlays WPF elements:

enter image description here

I'm not sure is it general problem with WPF, or something with DevExpress or OpenTK.

I would like to know, is there anything I can do, to solve this problem?

Edit: I'm using WindowsFormsHost control to put OpenTK's GLControl into WPF UserControl. And I'm using .Net 4.5.


Solution

  • The DockLayoutManager has known limitations when working with WindowsFormsHost. These limitations are general for WPF platform and they are powered by the current implementation of HwndHost (see WPF and Win32 Interoperation MSDN-article for details).

    You can try to overcome possible issues with dock panels overlapped by your OpenGL (WinForms) controls, by setting the DockLayoutManager.EnableWin32Compatibility property to true and the DockLayoutManager.FloatingMode property to FloatingMode.Desktop.