Skip to content

Commit 56cf3f2

Browse files
committed
incoming
1 parent 53aade5 commit 56cf3f2

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

microsoft-edge/webview2/concepts/overview-features-apis.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,36 @@ when adding an h4 heading, add nav link below the h2
1818
-->
1919

2020

21+
<!-- ---------- -->
22+
###### Show WPF elements on top of the WebView2 layer (WebView2CompositionControl) - INCOMING
23+
24+
The `WebView2CompositionControl` prevents the WebView2 control from being the topmost layer in a WPF app and obscuring any WPF elements. `Microsoft.Web.WebView2.Wpf.WebView2CompositionControl` is a drop-in replacement for the standard WPF WebView2 control. Both the WebView2 control and `WebView2CompositionControl` implement the `Microsoft.Web.WebView2.Wpf.IWebView2` interface. Both of them derive from `FrameworkElement`, as follows:
25+
* `FrameworkElement` -> `HwndHost` -> `WebView2`.
26+
* `FrameworkElement` -> `Control` -> `WebView2CompositionControl`.
27+
28+
Background: If you're building a Windows Presentation Foundation (WPF) app and using the WebView2 control, you may find that your app runs into "airspace" issues, where the WebView2 control is always displayed on top, hiding any WPF elements in the same location, even if you try to specify the WPF elements to be above the WebView2 control (using visual tree order or the z-index property, for example).
29+
30+
This issue occurs because the WPF control uses the WPF `HwndHost` to host the Win32 WebView2 control, and `HwndHost` has an issue with airspace.
31+
32+
See also:
33+
* [Mitigating Airspace Issues In WPF Applications](https://dwayneneed.github.io/wpf/2013/02/26/mitigating-airspace-issues-in-wpf-applications.html)
34+
* [PR 4804: WPF Airspace - WebView2CompositionControl](https://github.com/MicrosoftEdge/WebView2Feedback/pull/4804/files?short_path=ebbc3ee#diff-ebbc3ee3560606e2823d68c134ea4aebdc1cb1252aaa9aa2b9a2815e2d8d36b2) - Spec.
35+
36+
##### [.NET/C#](#tab/dotnetcsharp)
37+
38+
* [WebView2CompositionControl Class](/dotnet/api/microsoft.web.webview2.wpf.webview2compositioncontrol)
39+
40+
##### [WinRT/C#](#tab/winrtcsharp)
41+
42+
n/a
43+
44+
##### [Win32/C++](#tab/win32cpp)
45+
46+
n/a
47+
48+
---
49+
50+
2151
<!-- ====================================================================== -->
2252
## Overview of top-level feature areas
2353

@@ -2986,6 +3016,7 @@ Use the following APIs to forward `IDropTarget` events from the system to the We
29863016

29873017
---
29883018

3019+
29893020
<!-- ------------------------------ -->
29903021
#### Accessibility
29913022

0 commit comments

Comments
 (0)