Back to Devexpress

WPF and HwndHost Descendant Interoperation Limitations

wpf-7551-controls-and-libraries-layout-management-dock-windows-wpf-and-winforms-interoperation-limitations.md

latest2.1 KB
Original Source

WPF and HwndHost Descendant Interoperation Limitations

  • Sep 27, 2022
  • 2 minutes to read

You can embed HwndHost descendant (WindowsFormsHost, WebBrowser, WebView2, and other) controls into WPF applications, as described in WPF and Win32 Interoperation Overview.

Limitations

  1. When you embed HwndHost descendant controls in WPF applications, controls are always displayed on top of WPF controls.

  2. HwndHost descendant controls cannot be displayed in WPF windows whose AllowsTransparency property is true.

Bypass Limitations

Set the DockLayoutManager.EnableWin32Compatibility property to true to bypass possible issues with auto-hide and floating panels that are overlapped by HwndHost descendant controls.

In this case, the AllowsTransparency property is also set to false for all floating WPF windows and force auto-hide panels to be drawn over a WindowsFormsHost object. The DockLayoutManager.EnableWin32Compatibility property is in effect for floating panels only when the DockLayoutManager.FloatingMode is set to Desktop.

HwndHost Descendant Controls in AutoHide Groups

If you place a HwndHost descendant control in an AutoHideGroup, set the DockLayoutManager‘s AutoHideGroupsCheckInterval property to 00:00:00:05. In this case, the AutoHideGroup will be hidden if you hover another layout element.