Skip to content

Commit

Permalink
Unify Windows shared source for BlazorWebView (dotnet#4159)
Browse files Browse the repository at this point in the history
* Change WPF/WinForms/MAUI to use shared source instead of old 'WebView2' package, which is now removed
* Remove interfaces/wrappers from WinForms/WPF/MAUI
  • Loading branch information
Eilon authored Jan 17, 2022
1 parent 8d8be50 commit 36d7e0e
Show file tree
Hide file tree
Showing 46 changed files with 83 additions and 1,776 deletions.
1 change: 0 additions & 1 deletion Microsoft.Maui-mac.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"src\\BlazorWebView\\samples\\MauiRazorClassLibrarySample\\MauiRazorClassLibrarySample.csproj",
"src\\BlazorWebView\\samples\\WebViewAppShared\\WebViewAppShared.csproj",
"src\\BlazorWebView\\src\\Maui\\Microsoft.AspNetCore.Components.WebView.Maui.csproj",
"src\\BlazorWebView\\src\\WebView2\\Microsoft.AspNetCore.Components.WebView.WebView2.csproj",
"src\\BlazorWebView\\tests\\MauiDeviceTests\\MauiBlazorWebView.DeviceTests.csproj",
"src\\Compatibility\\Android.AppLinks\\src\\Compatibility.Android.AppLinks.csproj",
"src\\Compatibility\\Android.FormsViewGroup\\src\\Compatibility.Android.FormsViewGroup-net6.csproj",
Expand Down
14 changes: 7 additions & 7 deletions Microsoft.Maui-net6.sln
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Resizetizer.UnitTests-net6"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{A8E9400E-70DD-421F-8609-1C2FA4AE8E71}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.WebView.WebView2", "src\BlazorWebView\src\WebView2\Microsoft.AspNetCore.Components.WebView.WebView2.csproj", "{5256004D-AA93-4C44-A59E-026E12756BD1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebViewAppShared", "src\BlazorWebView\samples\WebViewAppShared\WebViewAppShared.csproj", "{9F1E0CE0-BF56-433F-8238-6C2B880EEF18}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workload", "Workload", "{EC63FD88-5E12-46D7-B440-68F70241D987}"
Expand Down Expand Up @@ -198,6 +196,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{A9C514B9
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MauiBlazorWebView.DeviceTests", "src\BlazorWebView\tests\MauiDeviceTests\MauiBlazorWebView.DeviceTests.csproj", "{5FEA7500-0ACE-4C26-9A7B-2EB3958CBBC6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SharedSource", "SharedSource", "{4F2926C8-43AB-4328-A735-D9EAD699F81D}"
ProjectSection(SolutionItems) = preProject
src\BlazorWebView\src\SharedSource\QueryStringHelper.cs = src\BlazorWebView\src\SharedSource\QueryStringHelper.cs
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs = src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs
EndProjectSection
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\Compatibility\ControlGallery\src\Issues.Shared\Compatibility.ControlGallery.Issues.Shared.projitems*{0a39a74b-6f7a-4d41-84f2-b0ccdce899df}*SharedItemsImports = 5
Expand Down Expand Up @@ -293,10 +297,6 @@ Global
{05DB57B8-D0A5-499B-AD35-7093C2E9C9D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{05DB57B8-D0A5-499B-AD35-7093C2E9C9D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{05DB57B8-D0A5-499B-AD35-7093C2E9C9D7}.Release|Any CPU.Build.0 = Release|Any CPU
{5256004D-AA93-4C44-A59E-026E12756BD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5256004D-AA93-4C44-A59E-026E12756BD1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5256004D-AA93-4C44-A59E-026E12756BD1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5256004D-AA93-4C44-A59E-026E12756BD1}.Release|Any CPU.Build.0 = Release|Any CPU
{9F1E0CE0-BF56-433F-8238-6C2B880EEF18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9F1E0CE0-BF56-433F-8238-6C2B880EEF18}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9F1E0CE0-BF56-433F-8238-6C2B880EEF18}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -532,7 +532,6 @@ Global
{E25E7929-2423-4C8A-9B03-DC4C8B19A2E5} = {D5478E0A-5D9C-4C1F-980C-7A9FC71F925E}
{05DB57B8-D0A5-499B-AD35-7093C2E9C9D7} = {E25E7929-2423-4C8A-9B03-DC4C8B19A2E5}
{A8E9400E-70DD-421F-8609-1C2FA4AE8E71} = {1614D1A4-5C3D-4D5B-8C89-426E37A564EF}
{5256004D-AA93-4C44-A59E-026E12756BD1} = {ED7F28E0-D0AF-417D-983D-3D874EEE8554}
{9F1E0CE0-BF56-433F-8238-6C2B880EEF18} = {A8E9400E-70DD-421F-8609-1C2FA4AE8E71}
{91B7E807-1026-4238-A7C2-D7A02C66F141} = {EC63FD88-5E12-46D7-B440-68F70241D987}
{9D8171BD-0F66-4D97-9A38-46800FC6B710} = {EC63FD88-5E12-46D7-B440-68F70241D987}
Expand Down Expand Up @@ -595,6 +594,7 @@ Global
{532ACF23-381B-4F54-AEA9-25B5485F9148} = {E1082E26-D700-4127-9329-66D673FD2D55}
{A9C514B9-1EE2-4A12-8E8A-CE16D87545C3} = {1614D1A4-5C3D-4D5B-8C89-426E37A564EF}
{5FEA7500-0ACE-4C26-9A7B-2EB3958CBBC6} = {A9C514B9-1EE2-4A12-8E8A-CE16D87545C3}
{4F2926C8-43AB-4328-A735-D9EAD699F81D} = {ED7F28E0-D0AF-417D-983D-3D874EEE8554}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0B8ABEAD-D2B5-4370-A187-62B5ABE4EE50}
Expand Down
1 change: 0 additions & 1 deletion Microsoft.Maui.Packages-mac.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"path": "Microsoft.Maui-net6.sln",
"projects": [
"src\\BlazorWebView\\src\\Maui\\Microsoft.AspNetCore.Components.WebView.Maui.csproj",
"src\\BlazorWebView\\src\\WebView2\\Microsoft.AspNetCore.Components.WebView.WebView2.csproj",
"src\\Compatibility\\Android.FormsViewGroup\\src\\Compatibility.Android.FormsViewGroup-net6.csproj",
"src\\Compatibility\\Core\\src\\Compatibility-net6.csproj",
"src\\Controls\\Maps\\src\\Controls.Maps-net6.csproj",
Expand Down
1 change: 0 additions & 1 deletion Microsoft.Maui.Packages-net6.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"path": "Microsoft.Maui-net6.sln",
"projects": [
"src\\BlazorWebView\\src\\Maui\\Microsoft.AspNetCore.Components.WebView.Maui.csproj",
"src\\BlazorWebView\\src\\WebView2\\Microsoft.AspNetCore.Components.WebView.WebView2.csproj",
"src\\BlazorWebView\\src\\WindowsForms\\Microsoft.AspNetCore.Components.WebView.WindowsForms.csproj",
"src\\BlazorWebView\\src\\Wpf\\Microsoft.AspNetCore.Components.WebView.Wpf.csproj",
"src\\Compatibility\\Android.FormsViewGroup\\src\\Compatibility.Android.FormsViewGroup-net6.csproj",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFrameworks>net6.0;$(MauiPlatforms)</TargetFrameworks>
<Nullable>enable</Nullable>
<Description>Build .NET MAUI applications with Blazor web UI in the BlazorWebView control.</Description>
<DefineConstants>$(DefineConstants);WEBVIEW2_MAUI</DefineConstants>
</PropertyGroup>

<Import Project="..\..\..\..\.nuspec\Microsoft.Maui.Controls.MultiTargeting.targets" />
Expand All @@ -14,8 +15,7 @@
</ItemGroup>

<ItemGroup>
<Compile Include="..\SharedSource\QueryStringHelper.cs" Link="QueryStringHelper.cs" />
<Compile Include="..\WebView2\Internal\StaticContentProvider.cs" Link="Windows\SharedSource\StaticContentProvider.cs" />
<Compile Include="..\SharedSource\**\*.cs" Link="Windows\SharedSource\%(Filename)%(Extension)"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private void StartWebViewCoreIfPossible()
// the precedence of which files are loaded from where.
var customFileProvider = VirtualView.CreateFileProvider(contentRootDir) ?? new NullFileProvider();

_webviewManager = new WinUIWebViewManager(NativeView, new WinUIWebView2Wrapper(NativeView), Services!, ComponentsDispatcher, customFileProvider, VirtualView.JSComponents, hostPageRelativePath, contentRootDir);
_webviewManager = new WinUIWebViewManager(NativeView, Services!, ComponentsDispatcher, customFileProvider, VirtualView.JSComponents, hostPageRelativePath, contentRootDir);

if (RootComponents != null)
{
Expand Down
25 changes: 0 additions & 25 deletions src/BlazorWebView/src/Maui/Windows/DeferralWrapper.cs

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 36d7e0e

Please sign in to comment.