.Net Framework 4.8 WPF plugin containing WebView2. When deployed into a Delphi7 Host the webview doesn’t render.
When tested in VS2019 dev environment with a .Net host the webview renders correctly and displays html content.
The XAML containing the WebView is simple. The Red Stackpanel was added to test that the view was being displayed in Delphi Host. The PreviewMouse events added to catch a right click so we can log it. Right clicking when docked in Delphi doesn’t hit the events, again proving that the WebView hasn’t rendered on the page.
<UserControl x:Class="Savant.Pulse.Client.Plugin.PULHLP.Views.Main.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:main="clr-namespace:Savant.Pulse.Client.Plugin.PULHLP.Views.Main"
mc:Ignorable="d"
xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
DataContext="{dxmvvm:ViewModelSource Type=main:MainViewModel}"
d:DataContext="{d:DesignInstance main:MainViewModel, IsDesignTimeCreatable=True}">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Savant.Pulse.Client.Wpf.Views;component/Styles/Styles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<!--Top Section-->
<Grid.RowDefinitions>
<!--Tool Bar-->
<RowDefinition Height="40"/>
<!--Main Body-->
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--Tool Bar-->
<StackPanel Background="Red" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
<Border Grid.Row="1" BorderBrush="Gray" BorderThickness="0,1">
<wv2:WebView2 Name="WebView" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
MinWidth="600" MinHeight="800"
Source="{Binding Url}"
PreviewMouseRightButtonDown="WebView_OnPreviewMouseRightButtonDown"
PreviewMouseRightButtonUp="WebView_OnPreviewMouseRightButtonUp"/>
</Border>
</Grid>
</UserControl>
Checked Bindings to WebView assembly using Fuslog. All OK.
WebView2 nuget : Microsoft.Web.WebView2 1.0.1020.30