You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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).
87
+
##### [.NET/C#](#tab/dotnetcsharp)
90
88
91
-
This issue occurs because the WPF control uses the WPF `HwndHost` to host the Win32 WebView2 control, and `HwndHost` has an issue with airspace; see [Mitigating Airspace Issues In WPF Applications](https://dwayneneed.github.io/wpf/2013/02/26/mitigating-airspace-issues-in-wpf-applications.html).
###### Programmatically control Find operations (WebView2Find API)
136
+
###### Show WPF elements on top of the WebView2 layer (WebView2CompositionControl)
137
+
138
+
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:
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).
130
143
131
-
The WebView2Find API allows you to programmatically control **Find** operations, and enables adding the following functionality to your app:
144
+
This issue occurs because the WPF control uses the WPF `HwndHost` to host the Win32 WebView2 control, and `HwndHost` has an issue with airspace; see [Mitigating Airspace Issues In WPF Applications](https://dwayneneed.github.io/wpf/2013/02/26/mitigating-airspace-issues-in-wpf-applications.html).
*[CoreWebView2 Class](/microsoft-edge/webview2/reference/winrt/microsoft_web_webview2_core/corewebview2?view=webview2-winrt-1.0.3079-prerelease&preserve-view=true)<!-- todo: delete link to large old class -->
*[ICoreWebView2ExperimentalCompositionController5]<!-- todo: link -->
163
+
<!-- todo: add members of this new partial class, probably #5 -->
164
+
165
+
---
166
+
167
+
168
+
<!-- ---------- -->
169
+
###### Programmatically control Find operations (Find API)
170
+
171
+
The Find API allows you to programmatically control **Find** operations, and enables adding the following functionality to your app:
132
172
* Customize **Find** options, similar to **Ctrl+F** in Microsoft Edge.
133
173
* Find text strings and navigate among them within a WebView2 control.
134
174
* Programmatically initiate **Find** operations, and navigate **Find** results.
135
175
* Suppress the default **Find** UI.
136
176
* Track the status of **Find** operations, indicating completion, changes of match count, and changes of match index.
137
177
138
-
There are known issues with the WebView2Find API for PDF documents. When you view a PDF document within a WebView2 control, the **Find** feature currently only provides the number of matches found, and the first index.<!-- todo: clarify "index" --> We are actively investigating these issues, and we encourage you to report any problems you encounter, by using the [WebView2Feedback](https://github.com/MicrosoftEdge/WebViewFeedback) repo.
178
+
There are known issues with the Find API for PDF documents. When you view a PDF document within a WebView2 control, the **Find** feature currently only provides the number of matches found, and the first index.<!-- todo: clarify "index" --> We are actively investigating these issues, and we encourage you to report any problems you encounter, by using the [WebView2Feedback](https://github.com/MicrosoftEdge/WebViewFeedback) repo.
139
179
140
180
##### [.NET/C#](#tab/dotnetcsharp)
141
181
@@ -238,8 +278,6 @@ The `DragStarting` API overrides the default drag and drop behavior when running
0 commit comments