Hello,
I'm using WebView2 in document window.
Primary document/Active window is not switched properly if I set 'docking:InteropFocusTracking.IsEnabled="True"' to WebView2.
If I don't set 'docking:InteropFocusTracking.IsEnabled="True"', it is switched properly. (But other focus problem occur...)
Would you please check it?
If my code is not properly, could you please give me some advice?
You can see the problem in "Primary Document Tracking" sample with adding the following code.
- Change "Document3.txt" content to WebView2 and set "docking:InteropFocusTracking.IsEnabled" to true.
<sampleBrowser:ProductItemControl x:Class="ActiproSoftware.ProductSamples.DockingSamples.QuickStart.PrimaryDocumentTracking.MainControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:docking="http://schemas.actiprosoftware.com/winfx/xaml/docking" xmlns:sampleBrowser="clr-namespace:ActiproSoftware.SampleBrowser" xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared" xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"> ... <docking:DocumentWindow Title="Document3.txt" Description="Text document" FileName="Document3.txt" ImageSource="/Images/Icons/TextDocument16.png"> <wv2:WebView2 docking:InteropFocusTracking.IsEnabled="True" Source="https://docs.microsoft.com/en-us/" /> <!--<TextBox BorderThickness="0" Text="The third document." TextWrapping="Wrap" />--> </docking:DocumentWindow>
When switch tab from "Document1.txt" to "Document2.txt", primary document/active window is changed to "Document2.txt".
When switch tab from "Document3.txt" to "Document1.txt", primary document/active window is still "Document3.txt".