diff --git a/AspNetCore.sln b/AspNetCore.sln index 05051fd1c961..7599ccad65e6 100644 --- a/AspNetCore.sln +++ b/AspNetCore.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31324.12 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31320.298 MinimumVisualStudioVersion = 15.0.26124.0 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "eng", "eng", "{C28A32F6-8314-412E-9F3B-CBD31C23E878}" EndProject @@ -1554,7 +1554,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InProcessNewShimWebSite", " EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BrowserTesting", "BrowserTesting", "{8F33439F-5532-45D6-8A44-20EF9104AA9D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNetCore.BrowserTesting", "src\Shared\BrowserTesting\src\Microsoft.AspNetCore.BrowserTesting.csproj", "{B739074E-6652-4F5B-B37E-775DC2245FEC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.BrowserTesting", "src\Shared\BrowserTesting\src\Microsoft.AspNetCore.BrowserTesting.csproj", "{B739074E-6652-4F5B-B37E-775DC2245FEC}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WasmLinkerTest", "src\Components\WebAssembly\testassets\WasmLinkerTest\WasmLinkerTest.csproj", "{3B375FFC-1E38-453E-A26D-A510CCD3339E}" EndProject @@ -1570,57 +1570,21 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HostedBlazorWebassemblyApp. EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebView", "WebView", "{C445B129-0A4D-41F5-8347-6534B6B12303}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebView", "WebView", "{DF2765A8-3836-4C3F-B199-788F732848A8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.WebView", "src\Components\WebView\WebView\src\Microsoft.AspNetCore.Components.WebView.csproj", "{35B8F997-C8BC-41C8-AA4D-5BD9F8D6069E}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Platforms", "Platforms", "{8B196DE0-F585-43D6-BE72-6F15BB4EB5E5}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Wpf", "Wpf", "{5241CF68-66A0-4724-9BAA-36DB959A5B11}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.WebView.Wpf", "src\Components\WebView\Platforms\Wpf\src\Microsoft.AspNetCore.Components.WebView.Wpf.csproj", "{7858C658-1669-4A73-89FE-9D9FF682E83E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.WebView.Test", "src\Components\WebView\WebView\test\Microsoft.AspNetCore.Components.WebView.Test.csproj", "{4276CAB2-80BF-438A-9E01-22BAE78D4930}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{D3B76F4E-A980-45BF-AEA1-EA3175B0B5A1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorWpfApp", "src\Components\WebView\Samples\BlazorWpfApp\BlazorWpfApp.csproj", "{1E9B6311-4B68-44C9-9571-1DB0C362987D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebView2", "WebView2", "{6685185E-C16A-4DAA-B16B-95E8FF65DE82}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.WebView.WebView2", "src\Components\WebView\Platforms\WebView2\src\Microsoft.AspNetCore.Components.WebView.WebView2.csproj", "{621FB2DB-2446-46CD-AB7A-189B4CB14A41}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WinForms", "WinForms", "{D4E9A2C5-0838-42DF-BC80-C829C4C9137E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.WebView.WindowsForms", "src\Components\WebView\Platforms\WindowsForms\src\Microsoft.AspNetCore.Components.WebView.WindowsForms.csproj", "{3BA297F8-1CA1-492D-AE64-A60B825D8501}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorWinFormsApp", "src\Components\WebView\Samples\BlazorWinFormsApp\BlazorWinFormsApp.csproj", "{CC740832-D268-47A3-9058-B9054F8397E2}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Http.Abstractions.Microbenchmarks", "src\Http\Http.Abstractions\perf\Microbenchmarks\Microsoft.AspNetCore.Http.Abstractions.Microbenchmarks.csproj", "{3F752B48-2936-4FCA-B0DC-4AB0F788F897}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "testassets", "testassets", "{F0849E7E-61DB-4849-9368-9E7BC125DCB0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinFormsTestApp", "src\Components\WebView\Platforms\WindowsForms\testassets\WinFormsTestApp\WinFormsTestApp.csproj", "{99EE7769-3C81-477B-B947-0A5CBCD5B27D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "testassets", "testassets", "{94D0D6F3-8632-41DE-908B-47A787D570FF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfTestApp", "src\Components\WebView\Platforms\Wpf\testassets\WpfTestApp\WpfTestApp.csproj", "{036C6BDA-7B69-4E8C-A921-822DA5972A56}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebviewAppShared", "src\Components\WebView\Samples\WebviewAppShared\WebviewAppShared.csproj", "{64C3BAC8-C4F8-466A-9E84-0400EE54B25A}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestStartupAssembly1", "src\Hosting\test\testassets\TestStartupAssembly1\TestStartupAssembly1.csproj", "{262FF30C-34B4-462D-B5E2-0DABB9196E40}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Spa", "Spa", "{0A064174-8E5C-4F97-B941-A4E302661DF2}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SpaProxy", "SpaProxy", "{5AC2A052-1D4F-4C2F-BCF5-3F07A3E31857}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNetCore.SpaProxy", "src\Middleware\Spa\SpaProxy\src\Microsoft.AspNetCore.SpaProxy.csproj", "{0DBACF8E-2EDB-47FC-B998-B76522637B2E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SpaProxy", "src\Middleware\Spa\SpaProxy\src\Microsoft.AspNetCore.SpaProxy.csproj", "{0DBACF8E-2EDB-47FC-B998-B76522637B2E}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SpaServices.Extensions", "SpaServices.Extensions", "{7F99E967-3DC1-4198-9D55-47CD9471D0B6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNetCore.SpaServices.Extensions", "src\Middleware\Spa\SpaServices.Extensions\src\Microsoft.AspNetCore.SpaServices.Extensions.csproj", "{DF4637DA-5F07-4903-8461-4E2DAB235F3C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SpaServices.Extensions", "src\Middleware\Spa\SpaServices.Extensions\src\Microsoft.AspNetCore.SpaServices.Extensions.csproj", "{DF4637DA-5F07-4903-8461-4E2DAB235F3C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNetCore.SpaServices.Extensions.Tests", "src\Middleware\Spa\SpaServices.Extensions\test\Microsoft.AspNetCore.SpaServices.Extensions.Tests.csproj", "{AAB50C64-39AA-4AED-8E9C-50D68E7751AD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SpaServices.Extensions.Tests", "src\Middleware\Spa\SpaServices.Extensions\test\Microsoft.AspNetCore.SpaServices.Extensions.Tests.csproj", "{AAB50C64-39AA-4AED-8E9C-50D68E7751AD}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MinimalSample", "src\Http\samples\MinimalSample\MinimalSample.csproj", "{9647D8B7-4616-4E05-B258-BAD5CAEEDD38}" EndProject @@ -1644,6 +1608,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Featur EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.Migration.E2ETests", "src\Components\test\E2ETestMigration\Microsoft.AspNetCore.Components.Migration.E2ETests.csproj", "{A1D02CE6-1077-410A-81CB-D4BD500FD765}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.WebView", "src\Components\WebView\WebView\src\Microsoft.AspNetCore.Components.WebView.csproj", "{3044DFA5-DE4F-44D8-8DD8-EDF547BE513E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Components.WebView.Test", "src\Components\WebView\WebView\test\Microsoft.AspNetCore.Components.WebView.Test.csproj", "{4BD6F0DB-BE9C-4C54-B52A-D20B88855ED5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -7523,90 +7491,6 @@ Global {E18EF144-9C2C-4366-B54C-09ACF7692A4F}.Release|x64.Build.0 = Release|Any CPU {E18EF144-9C2C-4366-B54C-09ACF7692A4F}.Release|x86.ActiveCfg = Release|Any CPU {E18EF144-9C2C-4366-B54C-09ACF7692A4F}.Release|x86.Build.0 = Release|Any CPU - {35B8F997-C8BC-41C8-AA4D-5BD9F8D6069E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {35B8F997-C8BC-41C8-AA4D-5BD9F8D6069E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {35B8F997-C8BC-41C8-AA4D-5BD9F8D6069E}.Debug|x64.ActiveCfg = Debug|Any CPU - {35B8F997-C8BC-41C8-AA4D-5BD9F8D6069E}.Debug|x64.Build.0 = Debug|Any CPU - {35B8F997-C8BC-41C8-AA4D-5BD9F8D6069E}.Debug|x86.ActiveCfg = Debug|Any CPU - {35B8F997-C8BC-41C8-AA4D-5BD9F8D6069E}.Debug|x86.Build.0 = Debug|Any CPU - {35B8F997-C8BC-41C8-AA4D-5BD9F8D6069E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {35B8F997-C8BC-41C8-AA4D-5BD9F8D6069E}.Release|Any CPU.Build.0 = Release|Any CPU - {35B8F997-C8BC-41C8-AA4D-5BD9F8D6069E}.Release|x64.ActiveCfg = Release|Any CPU - {35B8F997-C8BC-41C8-AA4D-5BD9F8D6069E}.Release|x64.Build.0 = Release|Any CPU - {35B8F997-C8BC-41C8-AA4D-5BD9F8D6069E}.Release|x86.ActiveCfg = Release|Any CPU - {35B8F997-C8BC-41C8-AA4D-5BD9F8D6069E}.Release|x86.Build.0 = Release|Any CPU - {7858C658-1669-4A73-89FE-9D9FF682E83E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7858C658-1669-4A73-89FE-9D9FF682E83E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7858C658-1669-4A73-89FE-9D9FF682E83E}.Debug|x64.ActiveCfg = Debug|Any CPU - {7858C658-1669-4A73-89FE-9D9FF682E83E}.Debug|x64.Build.0 = Debug|Any CPU - {7858C658-1669-4A73-89FE-9D9FF682E83E}.Debug|x86.ActiveCfg = Debug|Any CPU - {7858C658-1669-4A73-89FE-9D9FF682E83E}.Debug|x86.Build.0 = Debug|Any CPU - {7858C658-1669-4A73-89FE-9D9FF682E83E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7858C658-1669-4A73-89FE-9D9FF682E83E}.Release|Any CPU.Build.0 = Release|Any CPU - {7858C658-1669-4A73-89FE-9D9FF682E83E}.Release|x64.ActiveCfg = Release|Any CPU - {7858C658-1669-4A73-89FE-9D9FF682E83E}.Release|x64.Build.0 = Release|Any CPU - {7858C658-1669-4A73-89FE-9D9FF682E83E}.Release|x86.ActiveCfg = Release|Any CPU - {7858C658-1669-4A73-89FE-9D9FF682E83E}.Release|x86.Build.0 = Release|Any CPU - {4276CAB2-80BF-438A-9E01-22BAE78D4930}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4276CAB2-80BF-438A-9E01-22BAE78D4930}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4276CAB2-80BF-438A-9E01-22BAE78D4930}.Debug|x64.ActiveCfg = Debug|Any CPU - {4276CAB2-80BF-438A-9E01-22BAE78D4930}.Debug|x64.Build.0 = Debug|Any CPU - {4276CAB2-80BF-438A-9E01-22BAE78D4930}.Debug|x86.ActiveCfg = Debug|Any CPU - {4276CAB2-80BF-438A-9E01-22BAE78D4930}.Debug|x86.Build.0 = Debug|Any CPU - {4276CAB2-80BF-438A-9E01-22BAE78D4930}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4276CAB2-80BF-438A-9E01-22BAE78D4930}.Release|Any CPU.Build.0 = Release|Any CPU - {4276CAB2-80BF-438A-9E01-22BAE78D4930}.Release|x64.ActiveCfg = Release|Any CPU - {4276CAB2-80BF-438A-9E01-22BAE78D4930}.Release|x64.Build.0 = Release|Any CPU - {4276CAB2-80BF-438A-9E01-22BAE78D4930}.Release|x86.ActiveCfg = Release|Any CPU - {4276CAB2-80BF-438A-9E01-22BAE78D4930}.Release|x86.Build.0 = Release|Any CPU - {1E9B6311-4B68-44C9-9571-1DB0C362987D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1E9B6311-4B68-44C9-9571-1DB0C362987D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1E9B6311-4B68-44C9-9571-1DB0C362987D}.Debug|x64.ActiveCfg = Debug|Any CPU - {1E9B6311-4B68-44C9-9571-1DB0C362987D}.Debug|x64.Build.0 = Debug|Any CPU - {1E9B6311-4B68-44C9-9571-1DB0C362987D}.Debug|x86.ActiveCfg = Debug|Any CPU - {1E9B6311-4B68-44C9-9571-1DB0C362987D}.Debug|x86.Build.0 = Debug|Any CPU - {1E9B6311-4B68-44C9-9571-1DB0C362987D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1E9B6311-4B68-44C9-9571-1DB0C362987D}.Release|Any CPU.Build.0 = Release|Any CPU - {1E9B6311-4B68-44C9-9571-1DB0C362987D}.Release|x64.ActiveCfg = Release|Any CPU - {1E9B6311-4B68-44C9-9571-1DB0C362987D}.Release|x64.Build.0 = Release|Any CPU - {1E9B6311-4B68-44C9-9571-1DB0C362987D}.Release|x86.ActiveCfg = Release|Any CPU - {1E9B6311-4B68-44C9-9571-1DB0C362987D}.Release|x86.Build.0 = Release|Any CPU - {621FB2DB-2446-46CD-AB7A-189B4CB14A41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {621FB2DB-2446-46CD-AB7A-189B4CB14A41}.Debug|Any CPU.Build.0 = Debug|Any CPU - {621FB2DB-2446-46CD-AB7A-189B4CB14A41}.Debug|x64.ActiveCfg = Debug|Any CPU - {621FB2DB-2446-46CD-AB7A-189B4CB14A41}.Debug|x64.Build.0 = Debug|Any CPU - {621FB2DB-2446-46CD-AB7A-189B4CB14A41}.Debug|x86.ActiveCfg = Debug|Any CPU - {621FB2DB-2446-46CD-AB7A-189B4CB14A41}.Debug|x86.Build.0 = Debug|Any CPU - {621FB2DB-2446-46CD-AB7A-189B4CB14A41}.Release|Any CPU.ActiveCfg = Release|Any CPU - {621FB2DB-2446-46CD-AB7A-189B4CB14A41}.Release|Any CPU.Build.0 = Release|Any CPU - {621FB2DB-2446-46CD-AB7A-189B4CB14A41}.Release|x64.ActiveCfg = Release|Any CPU - {621FB2DB-2446-46CD-AB7A-189B4CB14A41}.Release|x64.Build.0 = Release|Any CPU - {621FB2DB-2446-46CD-AB7A-189B4CB14A41}.Release|x86.ActiveCfg = Release|Any CPU - {621FB2DB-2446-46CD-AB7A-189B4CB14A41}.Release|x86.Build.0 = Release|Any CPU - {3BA297F8-1CA1-492D-AE64-A60B825D8501}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3BA297F8-1CA1-492D-AE64-A60B825D8501}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3BA297F8-1CA1-492D-AE64-A60B825D8501}.Debug|x64.ActiveCfg = Debug|Any CPU - {3BA297F8-1CA1-492D-AE64-A60B825D8501}.Debug|x64.Build.0 = Debug|Any CPU - {3BA297F8-1CA1-492D-AE64-A60B825D8501}.Debug|x86.ActiveCfg = Debug|Any CPU - {3BA297F8-1CA1-492D-AE64-A60B825D8501}.Debug|x86.Build.0 = Debug|Any CPU - {3BA297F8-1CA1-492D-AE64-A60B825D8501}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3BA297F8-1CA1-492D-AE64-A60B825D8501}.Release|Any CPU.Build.0 = Release|Any CPU - {3BA297F8-1CA1-492D-AE64-A60B825D8501}.Release|x64.ActiveCfg = Release|Any CPU - {3BA297F8-1CA1-492D-AE64-A60B825D8501}.Release|x64.Build.0 = Release|Any CPU - {3BA297F8-1CA1-492D-AE64-A60B825D8501}.Release|x86.ActiveCfg = Release|Any CPU - {3BA297F8-1CA1-492D-AE64-A60B825D8501}.Release|x86.Build.0 = Release|Any CPU - {CC740832-D268-47A3-9058-B9054F8397E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CC740832-D268-47A3-9058-B9054F8397E2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CC740832-D268-47A3-9058-B9054F8397E2}.Debug|x64.ActiveCfg = Debug|Any CPU - {CC740832-D268-47A3-9058-B9054F8397E2}.Debug|x64.Build.0 = Debug|Any CPU - {CC740832-D268-47A3-9058-B9054F8397E2}.Debug|x86.ActiveCfg = Debug|Any CPU - {CC740832-D268-47A3-9058-B9054F8397E2}.Debug|x86.Build.0 = Debug|Any CPU - {CC740832-D268-47A3-9058-B9054F8397E2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CC740832-D268-47A3-9058-B9054F8397E2}.Release|Any CPU.Build.0 = Release|Any CPU - {CC740832-D268-47A3-9058-B9054F8397E2}.Release|x64.ActiveCfg = Release|Any CPU - {CC740832-D268-47A3-9058-B9054F8397E2}.Release|x64.Build.0 = Release|Any CPU - {CC740832-D268-47A3-9058-B9054F8397E2}.Release|x86.ActiveCfg = Release|Any CPU - {CC740832-D268-47A3-9058-B9054F8397E2}.Release|x86.Build.0 = Release|Any CPU {3F752B48-2936-4FCA-B0DC-4AB0F788F897}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3F752B48-2936-4FCA-B0DC-4AB0F788F897}.Debug|Any CPU.Build.0 = Debug|Any CPU {3F752B48-2936-4FCA-B0DC-4AB0F788F897}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -7619,42 +7503,6 @@ Global {3F752B48-2936-4FCA-B0DC-4AB0F788F897}.Release|x64.Build.0 = Release|Any CPU {3F752B48-2936-4FCA-B0DC-4AB0F788F897}.Release|x86.ActiveCfg = Release|Any CPU {3F752B48-2936-4FCA-B0DC-4AB0F788F897}.Release|x86.Build.0 = Release|Any CPU - {99EE7769-3C81-477B-B947-0A5CBCD5B27D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {99EE7769-3C81-477B-B947-0A5CBCD5B27D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {99EE7769-3C81-477B-B947-0A5CBCD5B27D}.Debug|x64.ActiveCfg = Debug|Any CPU - {99EE7769-3C81-477B-B947-0A5CBCD5B27D}.Debug|x64.Build.0 = Debug|Any CPU - {99EE7769-3C81-477B-B947-0A5CBCD5B27D}.Debug|x86.ActiveCfg = Debug|Any CPU - {99EE7769-3C81-477B-B947-0A5CBCD5B27D}.Debug|x86.Build.0 = Debug|Any CPU - {99EE7769-3C81-477B-B947-0A5CBCD5B27D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {99EE7769-3C81-477B-B947-0A5CBCD5B27D}.Release|Any CPU.Build.0 = Release|Any CPU - {99EE7769-3C81-477B-B947-0A5CBCD5B27D}.Release|x64.ActiveCfg = Release|Any CPU - {99EE7769-3C81-477B-B947-0A5CBCD5B27D}.Release|x64.Build.0 = Release|Any CPU - {99EE7769-3C81-477B-B947-0A5CBCD5B27D}.Release|x86.ActiveCfg = Release|Any CPU - {99EE7769-3C81-477B-B947-0A5CBCD5B27D}.Release|x86.Build.0 = Release|Any CPU - {036C6BDA-7B69-4E8C-A921-822DA5972A56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {036C6BDA-7B69-4E8C-A921-822DA5972A56}.Debug|Any CPU.Build.0 = Debug|Any CPU - {036C6BDA-7B69-4E8C-A921-822DA5972A56}.Debug|x64.ActiveCfg = Debug|Any CPU - {036C6BDA-7B69-4E8C-A921-822DA5972A56}.Debug|x64.Build.0 = Debug|Any CPU - {036C6BDA-7B69-4E8C-A921-822DA5972A56}.Debug|x86.ActiveCfg = Debug|Any CPU - {036C6BDA-7B69-4E8C-A921-822DA5972A56}.Debug|x86.Build.0 = Debug|Any CPU - {036C6BDA-7B69-4E8C-A921-822DA5972A56}.Release|Any CPU.ActiveCfg = Release|Any CPU - {036C6BDA-7B69-4E8C-A921-822DA5972A56}.Release|Any CPU.Build.0 = Release|Any CPU - {036C6BDA-7B69-4E8C-A921-822DA5972A56}.Release|x64.ActiveCfg = Release|Any CPU - {036C6BDA-7B69-4E8C-A921-822DA5972A56}.Release|x64.Build.0 = Release|Any CPU - {036C6BDA-7B69-4E8C-A921-822DA5972A56}.Release|x86.ActiveCfg = Release|Any CPU - {036C6BDA-7B69-4E8C-A921-822DA5972A56}.Release|x86.Build.0 = Release|Any CPU - {64C3BAC8-C4F8-466A-9E84-0400EE54B25A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {64C3BAC8-C4F8-466A-9E84-0400EE54B25A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {64C3BAC8-C4F8-466A-9E84-0400EE54B25A}.Debug|x64.ActiveCfg = Debug|Any CPU - {64C3BAC8-C4F8-466A-9E84-0400EE54B25A}.Debug|x64.Build.0 = Debug|Any CPU - {64C3BAC8-C4F8-466A-9E84-0400EE54B25A}.Debug|x86.ActiveCfg = Debug|Any CPU - {64C3BAC8-C4F8-466A-9E84-0400EE54B25A}.Debug|x86.Build.0 = Debug|Any CPU - {64C3BAC8-C4F8-466A-9E84-0400EE54B25A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {64C3BAC8-C4F8-466A-9E84-0400EE54B25A}.Release|Any CPU.Build.0 = Release|Any CPU - {64C3BAC8-C4F8-466A-9E84-0400EE54B25A}.Release|x64.ActiveCfg = Release|Any CPU - {64C3BAC8-C4F8-466A-9E84-0400EE54B25A}.Release|x64.Build.0 = Release|Any CPU - {64C3BAC8-C4F8-466A-9E84-0400EE54B25A}.Release|x86.ActiveCfg = Release|Any CPU - {64C3BAC8-C4F8-466A-9E84-0400EE54B25A}.Release|x86.Build.0 = Release|Any CPU {262FF30C-34B4-462D-B5E2-0DABB9196E40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {262FF30C-34B4-462D-B5E2-0DABB9196E40}.Debug|Any CPU.Build.0 = Debug|Any CPU {262FF30C-34B4-462D-B5E2-0DABB9196E40}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -7811,6 +7659,30 @@ Global {A1D02CE6-1077-410A-81CB-D4BD500FD765}.Release|x64.Build.0 = Release|Any CPU {A1D02CE6-1077-410A-81CB-D4BD500FD765}.Release|x86.ActiveCfg = Release|Any CPU {A1D02CE6-1077-410A-81CB-D4BD500FD765}.Release|x86.Build.0 = Release|Any CPU + {3044DFA5-DE4F-44D8-8DD8-EDF547BE513E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3044DFA5-DE4F-44D8-8DD8-EDF547BE513E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3044DFA5-DE4F-44D8-8DD8-EDF547BE513E}.Debug|x64.ActiveCfg = Debug|Any CPU + {3044DFA5-DE4F-44D8-8DD8-EDF547BE513E}.Debug|x64.Build.0 = Debug|Any CPU + {3044DFA5-DE4F-44D8-8DD8-EDF547BE513E}.Debug|x86.ActiveCfg = Debug|Any CPU + {3044DFA5-DE4F-44D8-8DD8-EDF547BE513E}.Debug|x86.Build.0 = Debug|Any CPU + {3044DFA5-DE4F-44D8-8DD8-EDF547BE513E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3044DFA5-DE4F-44D8-8DD8-EDF547BE513E}.Release|Any CPU.Build.0 = Release|Any CPU + {3044DFA5-DE4F-44D8-8DD8-EDF547BE513E}.Release|x64.ActiveCfg = Release|Any CPU + {3044DFA5-DE4F-44D8-8DD8-EDF547BE513E}.Release|x64.Build.0 = Release|Any CPU + {3044DFA5-DE4F-44D8-8DD8-EDF547BE513E}.Release|x86.ActiveCfg = Release|Any CPU + {3044DFA5-DE4F-44D8-8DD8-EDF547BE513E}.Release|x86.Build.0 = Release|Any CPU + {4BD6F0DB-BE9C-4C54-B52A-D20B88855ED5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4BD6F0DB-BE9C-4C54-B52A-D20B88855ED5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4BD6F0DB-BE9C-4C54-B52A-D20B88855ED5}.Debug|x64.ActiveCfg = Debug|Any CPU + {4BD6F0DB-BE9C-4C54-B52A-D20B88855ED5}.Debug|x64.Build.0 = Debug|Any CPU + {4BD6F0DB-BE9C-4C54-B52A-D20B88855ED5}.Debug|x86.ActiveCfg = Debug|Any CPU + {4BD6F0DB-BE9C-4C54-B52A-D20B88855ED5}.Debug|x86.Build.0 = Debug|Any CPU + {4BD6F0DB-BE9C-4C54-B52A-D20B88855ED5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4BD6F0DB-BE9C-4C54-B52A-D20B88855ED5}.Release|Any CPU.Build.0 = Release|Any CPU + {4BD6F0DB-BE9C-4C54-B52A-D20B88855ED5}.Release|x64.ActiveCfg = Release|Any CPU + {4BD6F0DB-BE9C-4C54-B52A-D20B88855ED5}.Release|x64.Build.0 = Release|Any CPU + {4BD6F0DB-BE9C-4C54-B52A-D20B88855ED5}.Release|x86.ActiveCfg = Release|Any CPU + {4BD6F0DB-BE9C-4C54-B52A-D20B88855ED5}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -8588,25 +8460,7 @@ Global {1A5582DD-06F4-4427-BFDC-B021A84A01BC} = {B4226BE2-DCB7-40C5-93F2-94C9BD6F4394} {E18EF144-9C2C-4366-B54C-09ACF7692A4F} = {B4226BE2-DCB7-40C5-93F2-94C9BD6F4394} {C445B129-0A4D-41F5-8347-6534B6B12303} = {60D51C98-2CC0-40DF-B338-44154EFEE2FF} - {DF2765A8-3836-4C3F-B199-788F732848A8} = {C445B129-0A4D-41F5-8347-6534B6B12303} - {35B8F997-C8BC-41C8-AA4D-5BD9F8D6069E} = {DF2765A8-3836-4C3F-B199-788F732848A8} - {8B196DE0-F585-43D6-BE72-6F15BB4EB5E5} = {C445B129-0A4D-41F5-8347-6534B6B12303} - {5241CF68-66A0-4724-9BAA-36DB959A5B11} = {8B196DE0-F585-43D6-BE72-6F15BB4EB5E5} - {7858C658-1669-4A73-89FE-9D9FF682E83E} = {5241CF68-66A0-4724-9BAA-36DB959A5B11} - {4276CAB2-80BF-438A-9E01-22BAE78D4930} = {DF2765A8-3836-4C3F-B199-788F732848A8} - {D3B76F4E-A980-45BF-AEA1-EA3175B0B5A1} = {C445B129-0A4D-41F5-8347-6534B6B12303} - {1E9B6311-4B68-44C9-9571-1DB0C362987D} = {D3B76F4E-A980-45BF-AEA1-EA3175B0B5A1} - {6685185E-C16A-4DAA-B16B-95E8FF65DE82} = {8B196DE0-F585-43D6-BE72-6F15BB4EB5E5} - {621FB2DB-2446-46CD-AB7A-189B4CB14A41} = {6685185E-C16A-4DAA-B16B-95E8FF65DE82} - {D4E9A2C5-0838-42DF-BC80-C829C4C9137E} = {8B196DE0-F585-43D6-BE72-6F15BB4EB5E5} - {3BA297F8-1CA1-492D-AE64-A60B825D8501} = {D4E9A2C5-0838-42DF-BC80-C829C4C9137E} - {CC740832-D268-47A3-9058-B9054F8397E2} = {D3B76F4E-A980-45BF-AEA1-EA3175B0B5A1} {3F752B48-2936-4FCA-B0DC-4AB0F788F897} = {DCBBDB52-4A49-4141-8F4D-81C0FFFB7BD5} - {F0849E7E-61DB-4849-9368-9E7BC125DCB0} = {D4E9A2C5-0838-42DF-BC80-C829C4C9137E} - {99EE7769-3C81-477B-B947-0A5CBCD5B27D} = {F0849E7E-61DB-4849-9368-9E7BC125DCB0} - {94D0D6F3-8632-41DE-908B-47A787D570FF} = {5241CF68-66A0-4724-9BAA-36DB959A5B11} - {036C6BDA-7B69-4E8C-A921-822DA5972A56} = {94D0D6F3-8632-41DE-908B-47A787D570FF} - {64C3BAC8-C4F8-466A-9E84-0400EE54B25A} = {D3B76F4E-A980-45BF-AEA1-EA3175B0B5A1} {262FF30C-34B4-462D-B5E2-0DABB9196E40} = {C1409A8F-555A-4A88-B803-C6D3E8B6C3B0} {0A064174-8E5C-4F97-B941-A4E302661DF2} = {E5963C9F-20A6-4385-B364-814D2581FADF} {5AC2A052-1D4F-4C2F-BCF5-3F07A3E31857} = {0A064174-8E5C-4F97-B941-A4E302661DF2} @@ -8625,6 +8479,8 @@ Global {A07D3B13-388B-444F-9E37-DDC0787C4690} = {17F28812-983E-4415-A55D-842DD7EC6887} {09FFBC53-3EFF-45C4-9822-5D66089CD6AD} = {17F28812-983E-4415-A55D-842DD7EC6887} {A1D02CE6-1077-410A-81CB-D4BD500FD765} = {0508E463-0269-40C9-B5C2-3B600FB2A28B} + {3044DFA5-DE4F-44D8-8DD8-EDF547BE513E} = {C445B129-0A4D-41F5-8347-6534B6B12303} + {4BD6F0DB-BE9C-4C54-B52A-D20B88855ED5} = {C445B129-0A4D-41F5-8347-6534B6B12303} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {3E8720B3-DBDD-498C-B383-2CC32A054E8F} diff --git a/eng/Build.props b/eng/Build.props index b7cccd17b611..d1c5749b38cf 100644 --- a/eng/Build.props +++ b/eng/Build.props @@ -43,15 +43,6 @@ $(RepoRoot)src\SignalR\perf\benchmarkapps\**\*.csproj; " /> - - - diff --git a/eng/Dependencies.props b/eng/Dependencies.props index 556b3c015ede..b17675fe495d 100644 --- a/eng/Dependencies.props +++ b/eng/Dependencies.props @@ -130,7 +130,6 @@ and are generated based on the last package release. - diff --git a/eng/ProjectReferences.props b/eng/ProjectReferences.props index d86339df3c64..fd90ae09e737 100644 --- a/eng/ProjectReferences.props +++ b/eng/ProjectReferences.props @@ -150,9 +150,6 @@ - - - diff --git a/eng/Versions.props b/eng/Versions.props index 48db2a26fdd5..6a0ee9092912 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -200,7 +200,6 @@ 3.0.1 3.0.1 11.1.0 - 1.0.705.50 1.4.0 6.10.0 5.10.0-rc.7240 diff --git a/src/Components/Components.slnf b/src/Components/Components.slnf index d4b0893cf6f7..e0acf3741d83 100644 --- a/src/Components/Components.slnf +++ b/src/Components/Components.slnf @@ -35,6 +35,8 @@ "src\\Components\\WebAssembly\\testassets\\Wasm.Authentication.Server\\Wasm.Authentication.Server.csproj", "src\\Components\\WebAssembly\\testassets\\Wasm.Authentication.Shared\\Wasm.Authentication.Shared.csproj", "src\\Components\\WebAssembly\\testassets\\WasmLinkerTest\\WasmLinkerTest.csproj", + "src\\Components\\WebView\\WebView\\src\\Microsoft.AspNetCore.Components.WebView.csproj", + "src\\Components\\WebView\\WebView\\test\\Microsoft.AspNetCore.Components.WebView.Test.csproj", "src\\Components\\Web\\src\\Microsoft.AspNetCore.Components.Web.csproj", "src\\Components\\Web\\test\\Microsoft.AspNetCore.Components.Web.Tests.csproj", "src\\Components\\benchmarkapps\\Wasm.Performance\\Driver\\Wasm.Performance.Driver.csproj", @@ -57,10 +59,10 @@ "src\\Html.Abstractions\\src\\Microsoft.AspNetCore.Html.Abstractions.csproj", "src\\Http\\Authentication.Abstractions\\src\\Microsoft.AspNetCore.Authentication.Abstractions.csproj", "src\\Http\\Authentication.Core\\src\\Microsoft.AspNetCore.Authentication.Core.csproj", + "src\\Http\\Features\\src\\Microsoft.Extensions.Features.csproj", "src\\Http\\Headers\\src\\Microsoft.Net.Http.Headers.csproj", "src\\Http\\Http.Abstractions\\src\\Microsoft.AspNetCore.Http.Abstractions.csproj", "src\\Http\\Http.Extensions\\src\\Microsoft.AspNetCore.Http.Extensions.csproj", - "src\\Http\\Features\\src\\Microsoft.Extensions.Features.csproj", "src\\Http\\Http.Features\\src\\Microsoft.AspNetCore.Http.Features.csproj", "src\\Http\\Http\\src\\Microsoft.AspNetCore.Http.csproj", "src\\Http\\Routing.Abstractions\\src\\Microsoft.AspNetCore.Routing.Abstractions.csproj", diff --git a/src/Components/ComponentsNoDeps.slnf b/src/Components/ComponentsNoDeps.slnf index d2aa2f466730..7f1c9a961788 100644 --- a/src/Components/ComponentsNoDeps.slnf +++ b/src/Components/ComponentsNoDeps.slnf @@ -37,14 +37,6 @@ "src\\Components\\WebAssembly\\testassets\\Wasm.Authentication.Server\\Wasm.Authentication.Server.csproj", "src\\Components\\WebAssembly\\testassets\\Wasm.Authentication.Shared\\Wasm.Authentication.Shared.csproj", "src\\Components\\WebAssembly\\testassets\\WasmLinkerTest\\WasmLinkerTest.csproj", - "src\\Components\\WebView\\Platforms\\WebView2\\src\\Microsoft.AspNetCore.Components.WebView.WebView2.csproj", - "src\\Components\\WebView\\Platforms\\WindowsForms\\src\\Microsoft.AspNetCore.Components.WebView.WindowsForms.csproj", - "src\\Components\\WebView\\Platforms\\WindowsForms\\testassets\\WinFormsTestApp\\WinFormsTestApp.csproj", - "src\\Components\\WebView\\Platforms\\Wpf\\src\\Microsoft.AspNetCore.Components.WebView.Wpf.csproj", - "src\\Components\\WebView\\Platforms\\Wpf\\testassets\\WpfTestApp\\WpfTestApp.csproj", - "src\\Components\\WebView\\Samples\\BlazorWinFormsApp\\BlazorWinFormsApp.csproj", - "src\\Components\\WebView\\Samples\\BlazorWpfApp\\BlazorWpfApp.csproj", - "src\\Components\\WebView\\Samples\\WebviewAppShared\\WebviewAppShared.csproj", "src\\Components\\WebView\\WebView\\src\\Microsoft.AspNetCore.Components.WebView.csproj", "src\\Components\\WebView\\WebView\\test\\Microsoft.AspNetCore.Components.WebView.Test.csproj", "src\\Components\\Web\\src\\Microsoft.AspNetCore.Components.Web.csproj", @@ -61,4 +53,4 @@ "src\\Components\\test\\testassets\\TestServer\\Components.TestServer.csproj" ] } -} \ No newline at end of file +} diff --git a/src/Components/WebView/Platforms/WebView2/src/CoreWebView2WebResourceContextWrapper.cs b/src/Components/WebView/Platforms/WebView2/src/CoreWebView2WebResourceContextWrapper.cs deleted file mode 100644 index 9ebde6a2a2df..000000000000 --- a/src/Components/WebView/Platforms/WebView2/src/CoreWebView2WebResourceContextWrapper.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.AspNetCore.Components.WebView.WebView2 -{ - /// - /// Types in the Microsoft.AspNetCore.Components.WebView.WebView2 are not recommended for use outside - /// of the Blazor framework. These types will change in a future release. - /// - /// Specifies the web resource request contexts. - /// - public enum CoreWebView2WebResourceContextWrapper - { - /// - /// Specifies all resources. - /// - All, - /// - /// Specifies a document resources. - /// - Document, - /// - /// Specifies a CSS resources. - /// - Stylesheet, - /// - /// Specifies an image resources. - /// - Image, - /// - /// Specifies another media resource such as a video. - /// - Media, - /// - /// Specifies a font resource. - /// - Font, - /// - /// Specifies a script resource. - /// - Script, - /// - /// Specifies an XML HTTP request. - /// - XmlHttpRequest, - /// - /// Specifies a Fetch API communication. - /// - Fetch, - /// - /// Specifies a TextTrack resource. - /// - TextTrack, - /// - /// Specifies an EventSource API communication. - /// - EventSource, - /// - /// Specifies a WebSocket API communication. - /// - Websocket, - /// - /// Specifies a Web App Manifest. - /// - Manifest, - /// - /// Specifies a Signed HTTP Exchange. - /// - SignedExchange, - /// - /// Specifies a Ping request. - /// - Ping, - /// - /// Specifies a CSP Violation Report. - /// - CspViolationReport, - /// - /// Specifies an other resource. - /// - Other - } -} diff --git a/src/Components/WebView/Platforms/WebView2/src/ICoreWebView2AcceleratorKeyPressedEventArgsWrapper.cs b/src/Components/WebView/Platforms/WebView2/src/ICoreWebView2AcceleratorKeyPressedEventArgsWrapper.cs deleted file mode 100644 index 9674d539fa83..000000000000 --- a/src/Components/WebView/Platforms/WebView2/src/ICoreWebView2AcceleratorKeyPressedEventArgsWrapper.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.AspNetCore.Components.WebView.WebView2 -{ - /// - /// Types in the Microsoft.AspNetCore.Components.WebView.WebView2 are not recommended for use outside - /// of the Blazor framework. These types will change in a future release. - /// - /// Event args for the AcceleratorKeyPressed event. - /// - public interface ICoreWebView2AcceleratorKeyPressedEventArgsWrapper - { - /// - /// Gets the Win32 virtual key code of the key that was pressed or released. - /// - uint VirtualKey { get; } - - /// - /// Gets the LPARAM value that accompanied the window message. - /// - int KeyEventLParam { get; } - - /// - /// Indicates whether the AcceleratorKeyPressed event is handled by host. - /// - /// - /// If set to true then this prevents the WebView from performing the default action for this accelerator key. Otherwise the WebView will perform the default action for the accelerator key. - /// - bool Handled { get; set; } - } -} diff --git a/src/Components/WebView/Platforms/WebView2/src/ICoreWebView2SettingsWrapper.cs b/src/Components/WebView/Platforms/WebView2/src/ICoreWebView2SettingsWrapper.cs deleted file mode 100644 index 2211fbd044d8..000000000000 --- a/src/Components/WebView/Platforms/WebView2/src/ICoreWebView2SettingsWrapper.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.AspNetCore.Components.WebView.WebView2 -{ - /// - /// Types in the Microsoft.AspNetCore.Components.WebView.WebView2 are not recommended for use outside - /// of the Blazor framework. These types will change in a future release. - /// - /// Defines properties that enable, disable, or modify WebView features. - /// - /// - /// Setting changes made after event do not apply until the next top-level navigation. - /// - public interface ICoreWebView2SettingsWrapper - { - /// - /// Determines whether running JavaScript is enabled in all future navigations in the WebView. - /// - /// - /// This only affects scripts in the document. Scripts injected with runs even if script is disabled. The default value is true. - /// - public bool IsScriptEnabled { get; set; } - - /// - /// Determines whether communication from the host to the top-level HTML document of the WebView is allowed. - /// - /// - /// This is used when loading a new HTML document. If set to true, communication from the host to the top-level HTML document of the WebView is allowed using , , and message event of window.chrome.webview. Communication from the top-level HTML document of the WebView to the host is allowed using window.chrome.webview.postMessage function and the event. If set to false, then communication is disallowed. and fail and window.chrome.webview.postMessage fails by throwing an instance of an Error object. The default value is true. - /// - /// - /// - /// - public bool IsWebMessageEnabled { get; set; } - - /// - /// Determines whether WebView renders the default Javascript dialog box. - /// - /// - /// This is used when loading a new HTML document. If set to false, WebView does not render the default JavaScript dialog box (specifically those displayed by the JavaScript alert, confirm, prompt functions and beforeunload event). Instead, WebView raises event that contains all of the information for the dialog and allow the host app to show a custom UI. The default value is true. - /// - /// - public bool AreDefaultScriptDialogsEnabled { get; set; } - - /// - /// Determines whether the status bar is displayed. - /// - /// - /// The status bar is usually displayed in the lower left of the WebView and shows things such as the URI of a link when the user hovers over it and other information. The default value is true. - /// - public bool IsStatusBarEnabled { get; set; } - - /// - /// Determines whether the user is able to use the context menu or keyboard shortcuts to open the DevTools window. - /// - /// - /// The default value is true. - /// - public bool AreDevToolsEnabled { get; set; } - - /// - /// Determines whether the default context menus are shown to the user in WebView. - /// - /// - /// The default value is true. - /// - public bool AreDefaultContextMenusEnabled { get; set; } - - /// - /// Determines whether host objects are accessible from the page in WebView. - /// - /// - /// The default value is true. - /// - public bool AreHostObjectsAllowed { get; set; } - - /// - /// Determines whether the user is able to impact the zoom of the WebView. - /// - /// - /// When disabled, the user is not able to zoom using Ctrl++, Ctr+-, or Ctrl+mouse wheel, but the zoom is set using property. The default value is true. - /// - public bool IsZoomControlEnabled { get; set; } - - /// - /// Determines whether to disable built in error page for navigation failure and render process failure. - /// - /// - /// When disabled, blank page is displayed when related error happens. The default value is true. - /// - public bool IsBuiltInErrorPageEnabled { get; set; } - } -} diff --git a/src/Components/WebView/Platforms/WebView2/src/ICoreWebView2WebResourceRequestWrapper.cs b/src/Components/WebView/Platforms/WebView2/src/ICoreWebView2WebResourceRequestWrapper.cs deleted file mode 100644 index e8cf3e483389..000000000000 --- a/src/Components/WebView/Platforms/WebView2/src/ICoreWebView2WebResourceRequestWrapper.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.AspNetCore.Components.WebView.WebView2 -{ - /// - /// Types in the Microsoft.AspNetCore.Components.WebView.WebView2 are not recommended for use outside - /// of the Blazor framework. These types will change in a future release. - /// - /// An HTTP request used with the event. - /// - public interface ICoreWebView2WebResourceRequestWrapper - { - /// - /// Gets or sets the request URI. - /// - string Uri { get; set; } - - /// - /// Gets or sets the HTTP request method. - /// - string Method { get; set; } - - ///// - ///// Gets or sets the HTTP request message body as stream. - ///// - ///// - ///// POST data should be here. If a stream is set, which overrides the message body, the stream must have all the content data available by the time the event deferral of this request is completed. Stream should be agile or be created from a background STA to prevent performance impact to the UI thread. null means no content data. - ///// - ///// - //Stream Content { get; set; } - - ///// - ///// Gets the mutable HTTP request headers. - ///// - //ICoreWebView2HttpRequestHeadersWrapper Headers { get; } - } -} diff --git a/src/Components/WebView/Platforms/WebView2/src/ICoreWebView2WebResourceRequestedEventArgsWrapper.cs b/src/Components/WebView/Platforms/WebView2/src/ICoreWebView2WebResourceRequestedEventArgsWrapper.cs deleted file mode 100644 index 9260ee10475b..000000000000 --- a/src/Components/WebView/Platforms/WebView2/src/ICoreWebView2WebResourceRequestedEventArgsWrapper.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.IO; - -namespace Microsoft.AspNetCore.Components.WebView.WebView2 -{ - /// - /// Types in the Microsoft.AspNetCore.Components.WebView.WebView2 are not recommended for use outside - /// of the Blazor framework. These types will change in a future release. - /// - /// Event args for the WebResourceRequested event. - /// - public interface ICoreWebView2WebResourceRequestedEventArgsWrapper - { - /// - /// Gets the web resource request. - /// - /// - /// The request object may be missing some headers that are added by network stack at a later time. - /// - ICoreWebView2WebResourceRequestWrapper Request { get; } - - /// - /// Gets the web resource request context. - /// - CoreWebView2WebResourceContextWrapper ResourceContext { get; } - - /// - /// Set the response content for this web resource. - /// - /// - /// - /// - /// - void SetResponse(Stream content, int statusCode, string statusMessage, string headerString); - } -} diff --git a/src/Components/WebView/Platforms/WebView2/src/ICoreWebView2Wrapper.cs b/src/Components/WebView/Platforms/WebView2/src/ICoreWebView2Wrapper.cs deleted file mode 100644 index 284f160db5b3..000000000000 --- a/src/Components/WebView/Platforms/WebView2/src/ICoreWebView2Wrapper.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Threading.Tasks; - -namespace Microsoft.AspNetCore.Components.WebView.WebView2 -{ - /// - /// Types in the Microsoft.AspNetCore.Components.WebView.WebView2 are not recommended for use outside - /// of the Blazor framework. These types will change in a future release. - /// - /// Defines an abstraction for different WebView2 implementations on different platforms. - /// - public interface ICoreWebView2Wrapper - { - /// - /// Gets the object contains various modifiable settings for the running WebView. - /// - public ICoreWebView2SettingsWrapper Settings { get; } - - /// - /// Adds the provided JavaScript to a list of scripts that should be run after the global object has been created, but before the HTML document has been parsed and before any other script included by the HTML document is run. - /// - /// The JavaScript code to be run. - Task AddScriptToExecuteOnDocumentCreatedAsync(string javaScript); - - - /// - /// WebMessageReceived is raised when the IsWebMessageEnabled setting is set and the top-level document of the WebView runs window.chrome.webview.postMessage. - /// - Action AddWebMessageReceivedHandler(Action messageReceivedHandler); - - /// - /// Adds a URI and resource context filter to the WebResourceRequested event. - /// - /// An URI to be added to the WebResourceRequested event. - /// A resource context filter to be added to the WebResourceRequested event. - void AddWebResourceRequestedFilter(string uri, CoreWebView2WebResourceContextWrapper resourceContext); - - /// - /// WebResourceRequested is raised when the WebView is performing a URL request to a matching URL and resource context filter that was added with AddWebResourceRequestedFilter />. - /// - Action AddWebResourceRequestedHandler(EventHandler webResourceRequestedHandler); - - /// - /// Posts a message that is a simple rather than a JSON string representation of a JavaScript object. - /// - /// The web message to be posted to the top level document in this WebView. - void PostWebMessageAsString(string webMessageAsString); - } -} diff --git a/src/Components/WebView/Platforms/WebView2/src/IWebView2Wrapper.cs b/src/Components/WebView/Platforms/WebView2/src/IWebView2Wrapper.cs deleted file mode 100644 index f5dcd61d3f70..000000000000 --- a/src/Components/WebView/Platforms/WebView2/src/IWebView2Wrapper.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Threading.Tasks; - -namespace Microsoft.AspNetCore.Components.WebView.WebView2 -{ - /// - /// Types in the Microsoft.AspNetCore.Components.WebView.WebView2 are not recommended for use outside - /// of the Blazor framework. These types will change in a future release. - /// - /// Provides an abstraction for different UI frameworks to provide access to APIs from - /// Microsoft.Web.WebView2.Core.CoreWebView2 and related controls. - /// - public interface IWebView2Wrapper - { - /// - /// Creates a WebView2 Environment using the installed or a custom WebView2 Runtime version. - /// The implementation should store the CoreWebView2Environment created in this method so that it can - /// be used in . - /// - Task CreateEnvironmentAsync(); - - /// - /// The underlying CoreWebView2. Use this property to perform more operations on the WebView2 content than is exposed - /// on the WebView2. This value is null until it is initialized. You can force the underlying CoreWebView2 to - /// initialize via the InitializeAsync method. - /// - ICoreWebView2Wrapper CoreWebView2 { get; } - - /// - /// Gets or sets the source URI of the control. Setting the source URI causes page navigation. - /// - Uri Source { get; set; } - - /// - /// Explicitly trigger initialization of the control's CoreWebView2. The implementation should use the CoreWebView2Environment that was - /// created in . - /// - Task EnsureCoreWebView2Async(); - - /// - /// Event that occurs when an accelerator key is pressed. - /// - Action AddAcceleratorKeyPressedHandler(EventHandler eventHandler); - } -} diff --git a/src/Components/WebView/Platforms/WebView2/src/Microsoft.AspNetCore.Components.WebView.WebView2.csproj b/src/Components/WebView/Platforms/WebView2/src/Microsoft.AspNetCore.Components.WebView.WebView2.csproj deleted file mode 100644 index e50575b0ff51..000000000000 --- a/src/Components/WebView/Platforms/WebView2/src/Microsoft.AspNetCore.Components.WebView.WebView2.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - $(DefaultNetCoreTargetFramework)-windows - WebView2 wrappers for BlazorWebView components on Windows. - true - disable - - - - - - - diff --git a/src/Components/WebView/Platforms/WebView2/src/PublicAPI.Shipped.txt b/src/Components/WebView/Platforms/WebView2/src/PublicAPI.Shipped.txt deleted file mode 100644 index ab058de62d44..000000000000 --- a/src/Components/WebView/Platforms/WebView2/src/PublicAPI.Shipped.txt +++ /dev/null @@ -1 +0,0 @@ -#nullable enable diff --git a/src/Components/WebView/Platforms/WebView2/src/PublicAPI.Unshipped.txt b/src/Components/WebView/Platforms/WebView2/src/PublicAPI.Unshipped.txt deleted file mode 100644 index a992fe96f020..000000000000 --- a/src/Components/WebView/Platforms/WebView2/src/PublicAPI.Unshipped.txt +++ /dev/null @@ -1,75 +0,0 @@ -#nullable enable -Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper.All = 0 -> Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper.CspViolationReport = 15 -> Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper.Document = 1 -> Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper.EventSource = 10 -> Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper.Fetch = 8 -> Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper.Font = 5 -> Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper.Image = 3 -> Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper.Manifest = 12 -> Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper.Media = 4 -> Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper.Other = 16 -> Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper.Ping = 14 -> Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper.Script = 6 -> Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper.SignedExchange = 13 -> Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper.Stylesheet = 2 -> Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper.TextTrack = 9 -> Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper.Websocket = 11 -> Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper.XmlHttpRequest = 7 -> Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2AcceleratorKeyPressedEventArgsWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2AcceleratorKeyPressedEventArgsWrapper.Handled.get -> bool -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2AcceleratorKeyPressedEventArgsWrapper.Handled.set -> void -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2AcceleratorKeyPressedEventArgsWrapper.KeyEventLParam.get -> int -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2AcceleratorKeyPressedEventArgsWrapper.VirtualKey.get -> uint -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2SettingsWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2SettingsWrapper.AreDefaultContextMenusEnabled.get -> bool -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2SettingsWrapper.AreDefaultContextMenusEnabled.set -> void -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2SettingsWrapper.AreDefaultScriptDialogsEnabled.get -> bool -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2SettingsWrapper.AreDefaultScriptDialogsEnabled.set -> void -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2SettingsWrapper.AreDevToolsEnabled.get -> bool -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2SettingsWrapper.AreDevToolsEnabled.set -> void -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2SettingsWrapper.AreHostObjectsAllowed.get -> bool -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2SettingsWrapper.AreHostObjectsAllowed.set -> void -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2SettingsWrapper.IsBuiltInErrorPageEnabled.get -> bool -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2SettingsWrapper.IsBuiltInErrorPageEnabled.set -> void -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2SettingsWrapper.IsScriptEnabled.get -> bool -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2SettingsWrapper.IsScriptEnabled.set -> void -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2SettingsWrapper.IsStatusBarEnabled.get -> bool -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2SettingsWrapper.IsStatusBarEnabled.set -> void -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2SettingsWrapper.IsWebMessageEnabled.get -> bool -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2SettingsWrapper.IsWebMessageEnabled.set -> void -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2SettingsWrapper.IsZoomControlEnabled.get -> bool -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2SettingsWrapper.IsZoomControlEnabled.set -> void -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2WebResourceRequestWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2WebResourceRequestedEventArgsWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2WebResourceRequestedEventArgsWrapper.ResourceContext.get -> Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper -Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2Wrapper -Microsoft.AspNetCore.Components.WebView.WebView2.IWebView2Wrapper -Microsoft.AspNetCore.Components.WebView.WebView2.WebMessageReceivedEventArgs -virtual Microsoft.AspNetCore.Components.WebView.WebView2.WebView2WebViewManager.QueueBlazorStart() -> void -~Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2WebResourceRequestWrapper.Method.get -> string -~Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2WebResourceRequestWrapper.Method.set -> void -~Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2WebResourceRequestWrapper.Uri.get -> string -~Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2WebResourceRequestWrapper.Uri.set -> void -~Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2WebResourceRequestedEventArgsWrapper.Request.get -> Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2WebResourceRequestWrapper -~Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2WebResourceRequestedEventArgsWrapper.SetResponse(System.IO.Stream content, int statusCode, string statusMessage, string headerString) -> void -~Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2Wrapper.AddScriptToExecuteOnDocumentCreatedAsync(string javaScript) -> System.Threading.Tasks.Task -~Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2Wrapper.AddWebMessageReceivedHandler(System.Action messageReceivedHandler) -> System.Action -~Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2Wrapper.AddWebResourceRequestedFilter(string uri, Microsoft.AspNetCore.Components.WebView.WebView2.CoreWebView2WebResourceContextWrapper resourceContext) -> void -~Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2Wrapper.AddWebResourceRequestedHandler(System.EventHandler webResourceRequestedHandler) -> System.Action -~Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2Wrapper.PostWebMessageAsString(string webMessageAsString) -> void -~Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2Wrapper.Settings.get -> Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2SettingsWrapper -~Microsoft.AspNetCore.Components.WebView.WebView2.IWebView2Wrapper.AddAcceleratorKeyPressedHandler(System.EventHandler eventHandler) -> System.Action -~Microsoft.AspNetCore.Components.WebView.WebView2.IWebView2Wrapper.CoreWebView2.get -> Microsoft.AspNetCore.Components.WebView.WebView2.ICoreWebView2Wrapper -~Microsoft.AspNetCore.Components.WebView.WebView2.IWebView2Wrapper.CreateEnvironmentAsync() -> System.Threading.Tasks.Task -~Microsoft.AspNetCore.Components.WebView.WebView2.IWebView2Wrapper.EnsureCoreWebView2Async() -> System.Threading.Tasks.Task -~Microsoft.AspNetCore.Components.WebView.WebView2.IWebView2Wrapper.Source.get -> System.Uri -~Microsoft.AspNetCore.Components.WebView.WebView2.IWebView2Wrapper.Source.set -> void -Microsoft.AspNetCore.Components.WebView.WebView2.WebView2WebViewManager -~Microsoft.AspNetCore.Components.WebView.WebView2.WebMessageReceivedEventArgs.Source.get -> string -~Microsoft.AspNetCore.Components.WebView.WebView2.WebMessageReceivedEventArgs.WebMessageAsString.get -> string -~Microsoft.AspNetCore.Components.WebView.WebView2.WebMessageReceivedEventArgs.WebMessageReceivedEventArgs(string source, string webMessageAsString) -> void -~Microsoft.AspNetCore.Components.WebView.WebView2.WebView2WebViewManager.WebView2WebViewManager(Microsoft.AspNetCore.Components.WebView.WebView2.IWebView2Wrapper webview, System.IServiceProvider services, Microsoft.AspNetCore.Components.Dispatcher dispatcher, Microsoft.Extensions.FileProviders.IFileProvider fileProvider, string hostPageRelativePath) -> void -~override Microsoft.AspNetCore.Components.WebView.WebView2.WebView2WebViewManager.NavigateCore(System.Uri absoluteUri) -> void -~override Microsoft.AspNetCore.Components.WebView.WebView2.WebView2WebViewManager.SendMessage(string message) -> void diff --git a/src/Components/WebView/Platforms/WebView2/src/WebMessageReceivedEventArgs.cs b/src/Components/WebView/Platforms/WebView2/src/WebMessageReceivedEventArgs.cs deleted file mode 100644 index a5817424aab0..000000000000 --- a/src/Components/WebView/Platforms/WebView2/src/WebMessageReceivedEventArgs.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; - -namespace Microsoft.AspNetCore.Components.WebView.WebView2 -{ - /// - /// Types in the Microsoft.AspNetCore.Components.WebView.WebView2 are not recommended for use outside - /// of the Blazor framework. These types will change in a future release. - /// - /// Event arguments for the WebMessageReceived event. - /// - public class WebMessageReceivedEventArgs : EventArgs - { - /// - /// Constructs a new instance of with the provider source and message. - /// - /// The URI of the document that sent this web message. - /// the message posted from the WebView content to the host as a . - public WebMessageReceivedEventArgs(string source, string webMessageAsString) - { - Source = source; - WebMessageAsString = webMessageAsString; - } - - /// - /// Gets the URI of the document that sent this web message. - /// - public string Source { get; } - - /// - /// Gets the message posted from the WebView content to the host as a . - /// - public string WebMessageAsString { get; } - } -} diff --git a/src/Components/WebView/Platforms/WebView2/src/WebView2WebViewManager.cs b/src/Components/WebView/Platforms/WebView2/src/WebView2WebViewManager.cs deleted file mode 100644 index 0d8e4e266c4d..000000000000 --- a/src/Components/WebView/Platforms/WebView2/src/WebView2WebViewManager.cs +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.Extensions.FileProviders; - -namespace Microsoft.AspNetCore.Components.WebView.WebView2 -{ - /// - /// An implementation of that uses the Edge WebView2 browser control - /// to render web content. - /// - public class WebView2WebViewManager : WebViewManager - { - // Using an IP address means that WebView2 doesn't wait for any DNS resolution, - // making it substantially faster. Note that this isn't real HTTP traffic, since - // we intercept all the requests within this origin. - private const string AppOrigin = "https://0.0.0.0/"; - - private readonly IWebView2Wrapper _webview; - private readonly Task _webviewReadyTask; - - /// - /// Constructs an instance of . - /// - /// A wrapper to access platform-specific WebView2 APIs. - /// A service provider containing services to be used by this class and also by application code. - /// A instance that can marshal calls to the required thread or sync context. - /// Provides static content to the webview. - /// Path to the host page within the . - public WebView2WebViewManager(IWebView2Wrapper webview, IServiceProvider services, Dispatcher dispatcher, IFileProvider fileProvider, string hostPageRelativePath) - : base(services, dispatcher, new Uri(AppOrigin), fileProvider, hostPageRelativePath) - { - _webview = webview ?? throw new ArgumentNullException(nameof(webview)); - - // Unfortunately the CoreWebView2 can only be instantiated asynchronously. - // We want the external API to behave as if initalization is synchronous, - // so keep track of a task we can await during LoadUri. - _webviewReadyTask = InitializeWebView2(); - } - - /// - protected override void NavigateCore(Uri absoluteUri) - { - _ = Dispatcher.InvokeAsync(async () => - { - await _webviewReadyTask; - _webview.Source = absoluteUri; - }); - } - - /// - protected override void SendMessage(string message) - => _webview.CoreWebView2.PostWebMessageAsString(message); - - private async Task InitializeWebView2() - { - await _webview.CreateEnvironmentAsync().ConfigureAwait(true); - await _webview.EnsureCoreWebView2Async(); - ApplyDefaultWebViewSettings(); - - _webview.CoreWebView2.AddWebResourceRequestedFilter($"{AppOrigin}*", CoreWebView2WebResourceContextWrapper.All); - var removeResourceCallback = _webview.CoreWebView2.AddWebResourceRequestedHandler((s, eventArgs) => - { - // Unlike server-side code, we get told exactly why the browser is making the request, - // so we can be smarter about fallback. We can ensure that 'fetch' requests never result - // in fallback, for example. - var allowFallbackOnHostPage = - eventArgs.ResourceContext == CoreWebView2WebResourceContextWrapper.Document || - eventArgs.ResourceContext == CoreWebView2WebResourceContextWrapper.Other; // e.g., dev tools requesting page source - - if (TryGetResponseContent(eventArgs.Request.Uri, allowFallbackOnHostPage, out var statusCode, out var statusMessage, out var content, out var headers)) - { - var headerString = GetHeaderString(headers); - eventArgs.SetResponse(content, statusCode, statusMessage, headerString); - } - }); - - // The code inside blazor.webview.js is meant to be agnostic to specific webview technologies, - // so the following is an adaptor from blazor.webview.js conventions to WebView2 APIs - await _webview.CoreWebView2.AddScriptToExecuteOnDocumentCreatedAsync(@" - window.external = { - sendMessage: message => { - window.chrome.webview.postMessage(message); - }, - receiveMessage: callback => { - window.chrome.webview.addEventListener('message', e => callback(e.data)); - } - }; - ").ConfigureAwait(true); - - QueueBlazorStart(); - - var removeMessageCallback = _webview.CoreWebView2.AddWebMessageReceivedHandler(e - => MessageReceived(new Uri(e.Source), e.WebMessageAsString)); - } - - /// - /// Override this method to queue a call to Blazor.start(). Not all platforms require this. - /// - protected virtual void QueueBlazorStart() - { - } - - private static string GetHeaderString(IDictionary headers) => - string.Join(Environment.NewLine, headers.Select(kvp => $"{kvp.Key}: {kvp.Value}")); - - private void ApplyDefaultWebViewSettings() - { - // Desktop applications typically don't want the default web browser context menu - _webview.CoreWebView2.Settings.AreDefaultContextMenusEnabled = false; - - // Desktop applications almost never want to show a URL preview when hovering over a link - _webview.CoreWebView2.Settings.IsStatusBarEnabled = false; - - // Desktop applications don't normally want to enable things like "alt-left to go back" - // or "ctrl+f to find". Developers should explicitly opt into allowing these. - // Issues #30511 and #30624 track making an option to control this. - var removeKeyPressCallback = _webview.AddAcceleratorKeyPressedHandler((sender, eventArgs) => - { - if (eventArgs.VirtualKey != 0x49) // Allow ctrl+shift+i to open dev tools, at least for now - { - // Note: due to what seems like a bug (https://github.com/MicrosoftEdge/WebView2Feedback/issues/549), - // setting eventArgs.Handled doesn't actually have any effect in WPF, even though it works fine in - // WinForms. Leaving the code here because it's supposedly fixed in a newer version. - eventArgs.Handled = true; - } - }); - } - } -} diff --git a/src/Components/WebView/Platforms/WindowsForms/src/BlazorWebView.cs b/src/Components/WebView/Platforms/WindowsForms/src/BlazorWebView.cs deleted file mode 100644 index 78a3df51baa3..000000000000 --- a/src/Components/WebView/Platforms/WindowsForms/src/BlazorWebView.cs +++ /dev/null @@ -1,218 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.IO; -using System.Linq; -using System.Windows.Forms; -using Microsoft.AspNetCore.Components.WebView.WebView2; -using Microsoft.Extensions.FileProviders; -using WebView2Control = Microsoft.Web.WebView2.WinForms.WebView2; - -namespace Microsoft.AspNetCore.Components.WebView.WindowsForms -{ - /// - /// A Windows Forms control for hosting Blazor web components locally in Windows desktop applications. - /// - public sealed class BlazorWebView : ContainerControl, IDisposable - { - private readonly WebView2Control _webview; - private WebView2WebViewManager _webviewManager; - private string _hostPage; - private IServiceProvider _services; - - /// - /// Creates a new instance of . - /// - public BlazorWebView() - { - Dispatcher = new WindowsFormsDispatcher(this); - RootComponents.CollectionChanged += HandleRootComponentsCollectionChanged; - - _webview = new WebView2Control() - { - Dock = DockStyle.Fill, - }; - ((BlazorWebViewControlCollection)Controls).AddInternal(_webview); - } - - /// - /// Returns the inner used by this control. - /// - /// - /// Directly using some functionality of the inner web view can cause unexpected results because its behavior - /// is controlled by the that is hosting it. - /// - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public WebView2Control WebView => _webview; - - private WindowsFormsDispatcher Dispatcher { get; } - - /// - protected override void OnCreateControl() - { - base.OnCreateControl(); - - StartWebViewCoreIfPossible(); - } - - /// - /// Path to the host page within the application's static files. For example, wwwroot\index.html. - /// This property must be set to a valid value for the Blazor components to start. - /// - [Category("Behavior")] - [Description(@"Path to the host page within the application's static files. Example: wwwroot\index.html.")] - public string HostPage - { - get => _hostPage; - set - { - _hostPage = value; - OnHostPagePropertyChanged(); - } - } - - // Learn more about these methods here: https://docs.microsoft.com/en-us/dotnet/desktop/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods?view=netframeworkdesktop-4.8 - private void ResetHostPage() => HostPage = null; - private bool ShouldSerializeHostPage() => !string.IsNullOrEmpty(HostPage); - - /// - /// A collection of instances that specify the Blazor types - /// to be used directly in the specified . - /// - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public ObservableCollection RootComponents { get; } = new(); - - /// - /// Gets or sets an containing services to be used by this control and also by application code. - /// This property must be set to a valid value for the Blazor components to start. - /// - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public IServiceProvider Services - { - get => _services; - set - { - _services = value; - OnServicesPropertyChanged(); - } - } - - private void OnHostPagePropertyChanged() => StartWebViewCoreIfPossible(); - - private void OnServicesPropertyChanged() => StartWebViewCoreIfPossible(); - - private bool IsAncestorSiteInDesignMode => - GetSitedParentSite(this) is ISite parentSite && parentSite.DesignMode; - - private ISite GetSitedParentSite(Control control) => - control is null - ? throw new ArgumentNullException(nameof(control)) - : control.Site != null || control.Parent is null - ? control.Site - : GetSitedParentSite(control.Parent); - - private bool RequiredStartupPropertiesSet => - Created && - _webview != null && - HostPage != null && - Services != null; - - private void StartWebViewCoreIfPossible() - { - // We never start the Blazor code in design time because it doesn't make sense to run - // a Blazor component in the designer. - if (!IsAncestorSiteInDesignMode && (!RequiredStartupPropertiesSet || _webviewManager != null)) - { - return; - } - - // We assume the host page is always in the root of the content directory, because it's - // unclear there's any other use case. We can add more options later if so. - var contentRootDir = Path.GetDirectoryName(Path.GetFullPath(HostPage)); - var hostPageRelativePath = Path.GetRelativePath(contentRootDir, HostPage); - var fileProvider = new PhysicalFileProvider(contentRootDir); - - _webviewManager = new WebView2WebViewManager(new WindowsFormsWebView2Wrapper(_webview), Services, Dispatcher, fileProvider, hostPageRelativePath); - foreach (var rootComponent in RootComponents) - { - // Since the page isn't loaded yet, this will always complete synchronously - _ = rootComponent.AddToWebViewManagerAsync(_webviewManager); - } - _webviewManager.Navigate("/"); - } - - private void HandleRootComponentsCollectionChanged(object sender, NotifyCollectionChangedEventArgs eventArgs) - { - // If we haven't initialized yet, this is a no-op - if (_webviewManager != null) - { - // Dispatch because this is going to be async, and we want to catch any errors - _ = Dispatcher.InvokeAsync(async () => - { - var newItems = eventArgs.NewItems.Cast(); - var oldItems = eventArgs.OldItems.Cast(); - - foreach (var item in newItems.Except(oldItems)) - { - await item.AddToWebViewManagerAsync(_webviewManager); - } - - foreach (var item in oldItems.Except(newItems)) - { - await item.RemoveFromWebViewManagerAsync(_webviewManager); - } - }); - } - } - - /// - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - - if (disposing) - { - _webviewManager?.Dispose(); - _webview?.Dispose(); - } - } - - /// - protected override ControlCollection CreateControlsInstance() - { - return new BlazorWebViewControlCollection(this); - } - - /// - /// Custom control collection that ensures that only the owning can add - /// controls to it. - /// - private sealed class BlazorWebViewControlCollection : ControlCollection - { - public BlazorWebViewControlCollection(BlazorWebView owner) : base(owner) - { - } - - /// - /// This is the only API we use; everything else is blocked. - /// - /// - internal void AddInternal(Control value) => base.Add(value); - - // Everything below is overridden to protect the control collection as read-only. - public override bool IsReadOnly => true; - - public override void Add(Control value) => throw new NotSupportedException(); - public override void Clear() => throw new NotSupportedException(); - public override void Remove(Control value) => throw new NotSupportedException(); - public override void SetChildIndex(Control child, int newIndex) => throw new NotSupportedException(); - } - } -} diff --git a/src/Components/WebView/Platforms/WindowsForms/src/Microsoft.AspNetCore.Components.WebView.WindowsForms.csproj b/src/Components/WebView/Platforms/WindowsForms/src/Microsoft.AspNetCore.Components.WebView.WindowsForms.csproj deleted file mode 100644 index c0267e983273..000000000000 --- a/src/Components/WebView/Platforms/WindowsForms/src/Microsoft.AspNetCore.Components.WebView.WindowsForms.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - - $(DefaultNetCoreTargetFramework)-windows - Build Windows Forms applications with Blazor and WebView2. - true - true - disable - - - - - - - - - diff --git a/src/Components/WebView/Platforms/WindowsForms/src/PublicAPI.Shipped.txt b/src/Components/WebView/Platforms/WindowsForms/src/PublicAPI.Shipped.txt deleted file mode 100644 index ab058de62d44..000000000000 --- a/src/Components/WebView/Platforms/WindowsForms/src/PublicAPI.Shipped.txt +++ /dev/null @@ -1 +0,0 @@ -#nullable enable diff --git a/src/Components/WebView/Platforms/WindowsForms/src/PublicAPI.Unshipped.txt b/src/Components/WebView/Platforms/WindowsForms/src/PublicAPI.Unshipped.txt deleted file mode 100644 index 42ff8b15f587..000000000000 --- a/src/Components/WebView/Platforms/WindowsForms/src/PublicAPI.Unshipped.txt +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable -Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView -Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.BlazorWebView() -> void -~Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.HostPage.get -> string -~Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.HostPage.set -> void -~Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.RootComponents.get -> System.Collections.ObjectModel.ObservableCollection -~Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.Services.get -> System.IServiceProvider -~Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.Services.set -> void -~Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView.WebView.get -> Microsoft.Web.WebView2.WinForms.WebView2 -Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponent -~Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponent.ComponentType.get -> System.Type -~Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponent.Parameters.get -> System.Collections.Generic.IDictionary -~Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponent.RootComponent(string selector, System.Type componentType, System.Collections.Generic.IDictionary parameters) -> void -~Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponent.Selector.get -> string -Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentCollectionExtensions -~static Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentCollectionExtensions.Add(this System.Collections.ObjectModel.ObservableCollection components, string selector, System.Collections.Generic.IDictionary parameters = null) -> void -~static Microsoft.AspNetCore.Components.WebView.WindowsForms.RootComponentCollectionExtensions.Remove(this System.Collections.ObjectModel.ObservableCollection components, string selector) -> void diff --git a/src/Components/WebView/Platforms/WindowsForms/src/RootComponent.cs b/src/Components/WebView/Platforms/WindowsForms/src/RootComponent.cs deleted file mode 100644 index f4171bf806cb..000000000000 --- a/src/Components/WebView/Platforms/WindowsForms/src/RootComponent.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Components.WebView.WebView2; -using Microsoft.Web.WebView2.Core; -using WebView2Control = Microsoft.Web.WebView2.WinForms.WebView2; - -namespace Microsoft.AspNetCore.Components.WebView.WindowsForms -{ - /// - /// Describes a root component that can be added to a . - /// - public class RootComponent - { - /// - /// Constructs an instance of . - /// - /// The CSS selector string that specifies where in the document the component should be placed. This must be unique among the root components within the . - /// The type of the root component. This type must implement . - /// An optional dictionary of parameters to pass to the root component. - public RootComponent(string selector, Type componentType, IDictionary parameters) - { - if (string.IsNullOrWhiteSpace(selector)) - { - throw new ArgumentException($"'{nameof(selector)}' cannot be null or whitespace.", nameof(selector)); - } - - Selector = selector; - ComponentType = componentType ?? throw new ArgumentNullException(nameof(componentType)); - Parameters = parameters; - } - - /// - /// Gets the CSS selector string that specifies where in the document the component should be placed. - /// This must be unique among the root components within the . - /// - public string Selector { get; } - - /// - /// Gets the type of the root component. This type must implement . - /// - public Type ComponentType { get; } - - /// - /// Gets an optional dictionary of parameters to pass to the root component. - /// - public IDictionary Parameters { get; } - - internal Task AddToWebViewManagerAsync(WebViewManager webViewManager) - { - var parameterView = Parameters == null ? ParameterView.Empty : ParameterView.FromDictionary(Parameters); - return webViewManager.AddRootComponentAsync(ComponentType, Selector, parameterView); - } - - internal Task RemoveFromWebViewManagerAsync(WebView2WebViewManager webviewManager) - { - return webviewManager.RemoveRootComponentAsync(Selector); - } - } -} diff --git a/src/Components/WebView/Platforms/WindowsForms/src/RootComponentCollectionExtensions.cs b/src/Components/WebView/Platforms/WindowsForms/src/RootComponentCollectionExtensions.cs deleted file mode 100644 index a41971e4ef5d..000000000000 --- a/src/Components/WebView/Platforms/WindowsForms/src/RootComponentCollectionExtensions.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; - -namespace Microsoft.AspNetCore.Components.WebView.WindowsForms -{ - /// - /// Provides a set of extension methods for modifying collections of objects. - /// - public static class RootComponentCollectionExtensions - { - /// - /// Adds the component specified by to the collection specified by - /// to be associated with the selector specified by - /// and to be instantiated with the parameters specified by . - /// - /// The to add to the collection. - /// The collection to which the component should be added. - /// The selector to which the component will be associated. - /// The optional creation parameters for the component. - public static void Add(this ObservableCollection components, string selector, IDictionary parameters = null) - where TComponent : IComponent - { - components.Add(new RootComponent(selector, typeof(TComponent), parameters)); - } - - /// - /// Removes the component associated with the specified from the collection - /// specified by . - /// - /// The collection from which the component associated with the selector should be removed. - /// The selector associated with the component to be removed. - public static void Remove(this ObservableCollection components, string selector) - { - for (var i = 0; i < components.Count; i++) - { - if (components[i].Selector.Equals(selector, StringComparison.Ordinal)) - { - components.RemoveAt(i); - return; - } - } - - throw new ArgumentException($"There is no root component with selector '{selector}'.", nameof(selector)); - } - } -} diff --git a/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsCoreWebView2AcceleratorKeyPressedEventArgsWrapper.cs b/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsCoreWebView2AcceleratorKeyPressedEventArgsWrapper.cs deleted file mode 100644 index cafd02faa1db..000000000000 --- a/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsCoreWebView2AcceleratorKeyPressedEventArgsWrapper.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using Microsoft.AspNetCore.Components.WebView.WebView2; -using Microsoft.Web.WebView2.Core; - -namespace Microsoft.AspNetCore.Components.WebView.WindowsForms -{ - internal class WindowsFormsCoreWebView2AcceleratorKeyPressedEventArgsWrapper : ICoreWebView2AcceleratorKeyPressedEventArgsWrapper - { - private readonly CoreWebView2AcceleratorKeyPressedEventArgs _eventArgs; - - public WindowsFormsCoreWebView2AcceleratorKeyPressedEventArgsWrapper(CoreWebView2AcceleratorKeyPressedEventArgs eventArgs) - { - _eventArgs = eventArgs; - } - public uint VirtualKey => _eventArgs.VirtualKey; - - public int KeyEventLParam => _eventArgs.KeyEventLParam; - - public bool Handled - { - get => _eventArgs.Handled; - set => _eventArgs.Handled = value; - } - } -} diff --git a/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsCoreWebView2SettingsWrapper.cs b/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsCoreWebView2SettingsWrapper.cs deleted file mode 100644 index 19d2d1da691c..000000000000 --- a/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsCoreWebView2SettingsWrapper.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using Microsoft.AspNetCore.Components.WebView.WebView2; -using Microsoft.Web.WebView2.Core; - -namespace Microsoft.AspNetCore.Components.WebView.WindowsForms -{ - internal class WindowsFormsCoreWebView2SettingsWrapper : ICoreWebView2SettingsWrapper - { - private readonly CoreWebView2Settings _settings; - - public WindowsFormsCoreWebView2SettingsWrapper(CoreWebView2Settings settings) - { - _settings = settings; - } - - public bool IsScriptEnabled - { - get => _settings.IsScriptEnabled; - set => _settings.IsScriptEnabled = value; - } - public bool IsWebMessageEnabled - { - get => _settings.IsWebMessageEnabled; - set => _settings.IsWebMessageEnabled = value; - } - public bool AreDefaultScriptDialogsEnabled - { - get => _settings.AreDefaultScriptDialogsEnabled; - set => _settings.AreDefaultScriptDialogsEnabled = value; - } - public bool IsStatusBarEnabled - { - get => _settings.IsStatusBarEnabled; - set => _settings.IsStatusBarEnabled = value; - } - public bool AreDevToolsEnabled - { - get => _settings.AreDevToolsEnabled; - set => _settings.AreDevToolsEnabled = value; - } - public bool AreDefaultContextMenusEnabled - { - get => _settings.AreDefaultContextMenusEnabled; - set => _settings.AreDefaultContextMenusEnabled = value; - } - public bool AreHostObjectsAllowed - { - get => _settings.AreHostObjectsAllowed; - set => _settings.AreHostObjectsAllowed = value; - } - public bool IsZoomControlEnabled - { - get => _settings.IsZoomControlEnabled; - set => _settings.IsZoomControlEnabled = value; - } - public bool IsBuiltInErrorPageEnabled - { - get => _settings.IsBuiltInErrorPageEnabled; - set => _settings.IsBuiltInErrorPageEnabled = value; - } - } -} diff --git a/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsCoreWebView2WebResourceRequestWrapper.cs b/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsCoreWebView2WebResourceRequestWrapper.cs deleted file mode 100644 index 58f4a18ac319..000000000000 --- a/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsCoreWebView2WebResourceRequestWrapper.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using Microsoft.AspNetCore.Components.WebView.WebView2; -using Microsoft.Web.WebView2.Core; - -namespace Microsoft.AspNetCore.Components.WebView.WindowsForms -{ - internal class WindowsFormsCoreWebView2WebResourceRequestWrapper : ICoreWebView2WebResourceRequestWrapper - { - private readonly CoreWebView2WebResourceRequestedEventArgs _webResourceRequestedEventArgs; - - public WindowsFormsCoreWebView2WebResourceRequestWrapper(CoreWebView2WebResourceRequestedEventArgs webResourceRequestedEventArgs) - { - _webResourceRequestedEventArgs = webResourceRequestedEventArgs; - } - - public string Uri - { - get => _webResourceRequestedEventArgs.Request.Uri; - set => _webResourceRequestedEventArgs.Request.Uri = value; - } - public string Method - { - get => _webResourceRequestedEventArgs.Request.Method; - set => _webResourceRequestedEventArgs.Request.Method = value; - } - } -} diff --git a/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsCoreWebView2WebResourceRequestedEventArgsWrapper.cs b/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsCoreWebView2WebResourceRequestedEventArgsWrapper.cs deleted file mode 100644 index 6fcc4a6e1182..000000000000 --- a/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsCoreWebView2WebResourceRequestedEventArgsWrapper.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.IO; -using Microsoft.AspNetCore.Components.WebView.WebView2; -using Microsoft.Web.WebView2.Core; - -namespace Microsoft.AspNetCore.Components.WebView.WindowsForms -{ - internal class WindowsFormsCoreWebView2WebResourceRequestedEventArgsWrapper : ICoreWebView2WebResourceRequestedEventArgsWrapper - { - private readonly CoreWebView2Environment _environment; - private readonly CoreWebView2WebResourceRequestedEventArgs _webResourceRequestedEventArgs; - - public WindowsFormsCoreWebView2WebResourceRequestedEventArgsWrapper(CoreWebView2Environment environment, CoreWebView2WebResourceRequestedEventArgs webResourceRequestedEventArgs) - { - _environment = environment; - _webResourceRequestedEventArgs = webResourceRequestedEventArgs; - - Request = new WindowsFormsCoreWebView2WebResourceRequestWrapper(webResourceRequestedEventArgs); - ResourceContext = (CoreWebView2WebResourceContextWrapper)webResourceRequestedEventArgs.ResourceContext; - } - - public ICoreWebView2WebResourceRequestWrapper Request { get; } - - public CoreWebView2WebResourceContextWrapper ResourceContext { get; } - - public void SetResponse(Stream content, int statusCode, string statusMessage, string headerString) - { - _webResourceRequestedEventArgs.Response = _environment.CreateWebResourceResponse(content, statusCode, statusMessage, headerString); - } - } -} diff --git a/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsCoreWebView2Wrapper.cs b/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsCoreWebView2Wrapper.cs deleted file mode 100644 index 23703629f158..000000000000 --- a/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsCoreWebView2Wrapper.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Components.WebView.WebView2; -using Microsoft.Web.WebView2.Core; - -namespace Microsoft.AspNetCore.Components.WebView.WindowsForms -{ - internal class WindowsFormsCoreWebView2Wrapper : ICoreWebView2Wrapper - { - private readonly WindowsFormsWebView2Wrapper _webView2; - private WindowsFormsCoreWebView2SettingsWrapper _settings; - - public WindowsFormsCoreWebView2Wrapper(WindowsFormsWebView2Wrapper webView2) - { - if (webView2 is null) - { - throw new ArgumentNullException(nameof(webView2)); - } - - _webView2 = webView2; - } - - public ICoreWebView2SettingsWrapper Settings - { - get - { - if (_settings == null) - { - _settings = new WindowsFormsCoreWebView2SettingsWrapper(_webView2.WebView2.CoreWebView2.Settings); - } - return _settings; - } - } - - public Task AddScriptToExecuteOnDocumentCreatedAsync(string javaScript) - { - return _webView2.WebView2.CoreWebView2.AddScriptToExecuteOnDocumentCreatedAsync(javaScript); - } - - public Action AddWebMessageReceivedHandler(Action messageReceivedHandler) - { - void nativeEventHandler(object sender, CoreWebView2WebMessageReceivedEventArgs e) - { - messageReceivedHandler(new WebMessageReceivedEventArgs(e.Source, e.TryGetWebMessageAsString())); - } - - _webView2.WebView2.CoreWebView2.WebMessageReceived += nativeEventHandler; - - // Return removal callback - return () => - { - _webView2.WebView2.CoreWebView2.WebMessageReceived -= nativeEventHandler; - }; - } - - public void AddWebResourceRequestedFilter(string uri, CoreWebView2WebResourceContextWrapper resourceContext) - { - _webView2.WebView2.CoreWebView2.AddWebResourceRequestedFilter(uri, (CoreWebView2WebResourceContext)resourceContext); - } - - public Action AddWebResourceRequestedHandler(EventHandler webResourceRequestedHandler) - { - void nativeEventHandler(object sender, CoreWebView2WebResourceRequestedEventArgs e) - { - webResourceRequestedHandler(_webView2.WebView2, new WindowsFormsCoreWebView2WebResourceRequestedEventArgsWrapper(_webView2.Environment, e)); - } - - _webView2.WebView2.CoreWebView2.WebResourceRequested += nativeEventHandler; - - // Return removal callback - return () => - { - _webView2.WebView2.CoreWebView2.WebResourceRequested -= nativeEventHandler; - }; - } - - public void PostWebMessageAsString(string webMessageAsString) - { - _webView2.WebView2.CoreWebView2.PostWebMessageAsString(webMessageAsString); - } - } -} diff --git a/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsDispatcher.cs b/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsDispatcher.cs deleted file mode 100644 index 7b33e5f1d119..000000000000 --- a/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsDispatcher.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Runtime.ExceptionServices; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace Microsoft.AspNetCore.Components.WebView.WindowsForms -{ - /// - /// Dispatcher implementation for Windows Forms that invokes methods on the UI thread. The - /// class uses the async pattern so everything must be mapped from the - /// pattern using techniques listed in https://docs.microsoft.com/dotnet/standard/asynchronous-programming-patterns/interop-with-other-asynchronous-patterns-and-types. - /// - internal class WindowsFormsDispatcher : Dispatcher - { - private static Action RethrowException = exception => - ExceptionDispatchInfo.Capture(exception).Throw(); - private readonly Control _dispatchThreadControl; - - /// - /// Creates a new instance of . - /// - /// A control that was created on the thread from which UI dispatches must - /// occur. This can typically be any control because all controls must have been created on the UI thread to - /// begin with. - public WindowsFormsDispatcher(Control dispatchThreadControl) - { - if (dispatchThreadControl is null) - { - throw new ArgumentNullException(nameof(dispatchThreadControl)); - } - - _dispatchThreadControl = dispatchThreadControl; - } - - public override bool CheckAccess() - => !_dispatchThreadControl.InvokeRequired; - - public override async Task InvokeAsync(Action workItem) - { - try - { - if (CheckAccess()) - { - workItem(); - } - else - { - var asyncResult = _dispatchThreadControl.BeginInvoke(workItem); - await Task.Factory.FromAsync(asyncResult, _dispatchThreadControl.EndInvoke); - } - } - catch (Exception ex) - { - // TODO: Determine whether this is the right kind of rethrowing pattern - // You do have to do something like this otherwise unhandled exceptions - // throw from inside Dispatcher.InvokeAsync are simply lost. - _ = _dispatchThreadControl.BeginInvoke(RethrowException, ex); - throw; - } - } - - public override async Task InvokeAsync(Func workItem) - { - try - { - if (CheckAccess()) - { - await workItem(); - } - else - { - var asyncResult = _dispatchThreadControl.BeginInvoke(workItem); - await Task.Factory.FromAsync(asyncResult, _dispatchThreadControl.EndInvoke); - } - } - catch (Exception ex) - { - // TODO: Determine whether this is the right kind of rethrowing pattern - // You do have to do something like this otherwise unhandled exceptions - // throw from inside Dispatcher.InvokeAsync are simply lost. - _ = _dispatchThreadControl.BeginInvoke(RethrowException, ex); - throw; - } - } - - public override async Task InvokeAsync(Func workItem) - { - try - { - if (CheckAccess()) - { - return workItem(); - } - else - { - var asyncResult = _dispatchThreadControl.BeginInvoke(workItem); - return await Task.Factory.FromAsync(asyncResult, result => (TResult)_dispatchThreadControl.EndInvoke(result)); - } - } - catch (Exception ex) - { - // TODO: Determine whether this is the right kind of rethrowing pattern - // You do have to do something like this otherwise unhandled exceptions - // throw from inside Dispatcher.InvokeAsync are simply lost. - _ = _dispatchThreadControl.BeginInvoke(RethrowException, ex); - throw; - } - } - - public override async Task InvokeAsync(Func> workItem) - { - try - { - if (CheckAccess()) - { - return await workItem(); - } - else - { - var asyncResult = _dispatchThreadControl.BeginInvoke(workItem); - return await Task.Factory.FromAsync(asyncResult, result => (TResult)_dispatchThreadControl.EndInvoke(result)); - } - } - catch (Exception ex) - { - // TODO: Determine whether this is the right kind of rethrowing pattern - // You do have to do something like this otherwise unhandled exceptions - // throw from inside Dispatcher.InvokeAsync are simply lost. - _ = _dispatchThreadControl.BeginInvoke(RethrowException, ex); - throw; - } - } - } -} diff --git a/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsWebView2Wrapper.cs b/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsWebView2Wrapper.cs deleted file mode 100644 index 6dfe85eefa31..000000000000 --- a/src/Components/WebView/Platforms/WindowsForms/src/WindowsFormsWebView2Wrapper.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Components.WebView.WebView2; -using Microsoft.Web.WebView2.Core; -using WebView2Control = Microsoft.Web.WebView2.WinForms.WebView2; - -namespace Microsoft.AspNetCore.Components.WebView.WindowsForms -{ - internal class WindowsFormsWebView2Wrapper : IWebView2Wrapper - { - private readonly WindowsFormsCoreWebView2Wrapper _coreWebView2Wrapper; - - public WindowsFormsWebView2Wrapper(WebView2Control webView2) - { - if (webView2 is null) - { - throw new ArgumentNullException(nameof(webView2)); - } - - WebView2 = webView2; - _coreWebView2Wrapper = new WindowsFormsCoreWebView2Wrapper(this); - } - - public ICoreWebView2Wrapper CoreWebView2 => _coreWebView2Wrapper; - - public Uri Source - { - get => WebView2.Source; - set => WebView2.Source = value; - } - - public WebView2Control WebView2 { get; } - - public CoreWebView2Environment Environment { get; set; } - - public Action AddAcceleratorKeyPressedHandler(EventHandler eventHandler) - { - EventHandler realHandler = (object sender, CoreWebView2AcceleratorKeyPressedEventArgs e) => - { - eventHandler(WebView2, new WindowsFormsCoreWebView2AcceleratorKeyPressedEventArgsWrapper(e)); - }; - WebView2.AcceleratorKeyPressed += realHandler; - - // Return removal callback - return () => { WebView2.AcceleratorKeyPressed -= realHandler; }; - } - - public async Task CreateEnvironmentAsync() - { - Environment = await CoreWebView2Environment.CreateAsync(); - } - - public Task EnsureCoreWebView2Async() - { - return WebView2.EnsureCoreWebView2Async(Environment); - } - } -} diff --git a/src/Components/WebView/Platforms/WindowsForms/testassets/WinFormsTestApp/Form1.Designer.cs b/src/Components/WebView/Platforms/WindowsForms/testassets/WinFormsTestApp/Form1.Designer.cs deleted file mode 100644 index 8760eff652f1..000000000000 --- a/src/Components/WebView/Platforms/WindowsForms/testassets/WinFormsTestApp/Form1.Designer.cs +++ /dev/null @@ -1,59 +0,0 @@ - -namespace WinFormsTestApp -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.blazorWebView1 = new Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView(); - this.SuspendLayout(); - // - // panel1 - // - this.blazorWebView1.Dock = System.Windows.Forms.DockStyle.Fill; - this.blazorWebView1.Location = new System.Drawing.Point(0, 0); - this.blazorWebView1.Name = "blazorWebView1"; - this.blazorWebView1.Size = new System.Drawing.Size(1024, 768); - this.blazorWebView1.TabIndex = 0; - // - // Form1 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 18F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1024, 768); - this.Controls.Add(this.blazorWebView1); - this.Name = "Form1"; - this.Text = "Form1"; - this.ResumeLayout(false); - - } - - #endregion - - private Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView blazorWebView1; - } -} diff --git a/src/Components/WebView/Platforms/WindowsForms/testassets/WinFormsTestApp/Form1.cs b/src/Components/WebView/Platforms/WindowsForms/testassets/WinFormsTestApp/Form1.cs deleted file mode 100644 index bef599065da5..000000000000 --- a/src/Components/WebView/Platforms/WindowsForms/testassets/WinFormsTestApp/Form1.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Windows.Forms; -using System.Net.Http; -using Microsoft.AspNetCore.Components.WebView.WindowsForms; -using Microsoft.Extensions.DependencyInjection; - -namespace WinFormsTestApp -{ - public partial class Form1 : Form - { - public Form1() - { - var serviceCollection = new ServiceCollection(); - serviceCollection.AddBlazorWebView(); - serviceCollection.AddSingleton(); - InitializeComponent(); - - blazorWebView1.HostPage = @"wwwroot\webviewhost.html"; - blazorWebView1.Services = serviceCollection.BuildServiceProvider(); - blazorWebView1.RootComponents.Add("root"); - } - } -} diff --git a/src/Components/WebView/Platforms/WindowsForms/testassets/WinFormsTestApp/Program.cs b/src/Components/WebView/Platforms/WindowsForms/testassets/WinFormsTestApp/Program.cs deleted file mode 100644 index 470004c189ae..000000000000 --- a/src/Components/WebView/Platforms/WindowsForms/testassets/WinFormsTestApp/Program.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Windows.Forms; - -namespace WinFormsTestApp -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - AppDomain.CurrentDomain.UnhandledException += (sender, error) => - { - MessageBox.Show(text: error.ExceptionObject.ToString(), caption: "Error"); - }; - - Application.SetHighDpiMode(HighDpiMode.SystemAware); - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); - } - } -} diff --git a/src/Components/WebView/Platforms/WindowsForms/testassets/WinFormsTestApp/WinFormsTestApp.csproj b/src/Components/WebView/Platforms/WindowsForms/testassets/WinFormsTestApp/WinFormsTestApp.csproj deleted file mode 100644 index bc3fb94fc15e..000000000000 --- a/src/Components/WebView/Platforms/WindowsForms/testassets/WinFormsTestApp/WinFormsTestApp.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - $(DefaultNetCoreTargetFramework)-windows - WinExe - true - false - - - - - - - - - - - - - PreserveNewest - - - - diff --git a/src/Components/WebView/Platforms/WindowsForms/testassets/WinFormsTestApp/wwwroot/css/app.css b/src/Components/WebView/Platforms/WindowsForms/testassets/WinFormsTestApp/wwwroot/css/app.css deleted file mode 100644 index 5053cb6b080c..000000000000 --- a/src/Components/WebView/Platforms/WindowsForms/testassets/WinFormsTestApp/wwwroot/css/app.css +++ /dev/null @@ -1,26 +0,0 @@ -#blazor-error-ui { - background: lightyellow; - bottom: 0; - box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); - display: none; - left: 0; - padding: 0.6rem 1.25rem 0.7rem 1.25rem; - position: fixed; - width: 100%; - z-index: 1000; -} - -#blazor-error-ui .dismiss { - cursor: pointer; - position: absolute; - right: 0.75rem; - top: 0.5rem; -} - -.valid.modified:not([type=checkbox]) { - outline: 1px solid #26b050; -} - -.invalid { - outline: 1px solid red; -} diff --git a/src/Components/WebView/Platforms/WindowsForms/testassets/WinFormsTestApp/wwwroot/webviewhost.html b/src/Components/WebView/Platforms/WindowsForms/testassets/WinFormsTestApp/wwwroot/webviewhost.html deleted file mode 100644 index 9a5a90e5c53f..000000000000 --- a/src/Components/WebView/Platforms/WindowsForms/testassets/WinFormsTestApp/wwwroot/webviewhost.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - WinFormsTestApp - - - - - - - - - - - - - - Loading... - - - - - - - - - - - - - - - - - - diff --git a/src/Components/WebView/Platforms/Wpf/src/BlazorWebView.cs b/src/Components/WebView/Platforms/Wpf/src/BlazorWebView.cs deleted file mode 100644 index a4aae055a15d..000000000000 --- a/src/Components/WebView/Platforms/Wpf/src/BlazorWebView.cs +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.IO; -using System.Linq; -using System.Windows; -using System.Windows.Controls; -using Microsoft.AspNetCore.Components.WebView.WebView2; -using Microsoft.Extensions.FileProviders; -using WebView2Control = Microsoft.Web.WebView2.Wpf.WebView2; - -namespace Microsoft.AspNetCore.Components.WebView.Wpf -{ - /// - /// A Windows Presentation Foundation (WPF) control for hosting Blazor web components locally in Windows desktop applications. - /// - public sealed class BlazorWebView : Control, IDisposable - { - #region Dependency property definitions - /// - /// The backing store for the property. - /// - public static readonly DependencyProperty HostPageProperty = DependencyProperty.Register( - name: nameof(HostPage), - propertyType: typeof(string), - ownerType: typeof(BlazorWebView), - typeMetadata: new PropertyMetadata(OnHostPagePropertyChanged)); - - /// - /// The backing store for the property. - /// - public static readonly DependencyProperty RootComponentsProperty = DependencyProperty.Register( - name: nameof(RootComponents), - propertyType: typeof(ObservableCollection), - ownerType: typeof(BlazorWebView)); - - /// - /// The backing store for the property. - /// - public static readonly DependencyProperty ServicesProperty = DependencyProperty.Register( - name: nameof(Services), - propertyType: typeof(IServiceProvider), - ownerType: typeof(BlazorWebView), - typeMetadata: new PropertyMetadata(OnServicesPropertyChanged)); - #endregion - - private const string webViewTemplateChildName = "WebView"; - private WebView2Control _webview; - private WebView2WebViewManager _webviewManager; - private bool _isDisposed; - - /// - /// Creates a new instance of . - /// - public BlazorWebView() - { - SetValue(RootComponentsProperty, new ObservableCollection()); - RootComponents.CollectionChanged += HandleRootComponentsCollectionChanged; - - Template = new ControlTemplate - { - VisualTree = new FrameworkElementFactory(typeof(WebView2Control), webViewTemplateChildName) - }; - } - - /// - /// Path to the host page within the application's static files. For example, wwwroot\index.html. - /// This property must be set to a valid value for the Blazor components to start. - /// - public string HostPage - { - get => (string)GetValue(HostPageProperty); - set => SetValue(HostPageProperty, value); - } - - /// - /// A collection of instances that specify the Blazor types - /// to be used directly in the specified . - /// - public ObservableCollection RootComponents => - (ObservableCollection)GetValue(RootComponentsProperty); - - /// - /// Gets or sets an containing services to be used by this control and also by application code. - /// This property must be set to a valid value for the Blazor components to start. - /// - public IServiceProvider Services - { - get => (IServiceProvider)GetValue(ServicesProperty); - set => SetValue(ServicesProperty, value); - } - - private static void OnServicesPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((BlazorWebView)d).OnServicesPropertyChanged(e); - - private void OnServicesPropertyChanged(DependencyPropertyChangedEventArgs e) => StartWebViewCoreIfPossible(); - - private static void OnHostPagePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((BlazorWebView)d).OnHostPagePropertyChanged(e); - - private void OnHostPagePropertyChanged(DependencyPropertyChangedEventArgs e) => StartWebViewCoreIfPossible(); - - private bool RequiredStartupPropertiesSet => - _webview != null && - HostPage != null && - Services != null; - - /// - public override void OnApplyTemplate() - { - CheckDisposed(); - - // Called when the control is created after its child control (the WebView2) is created from the Template property - base.OnApplyTemplate(); - - if (_webview == null) - { - _webview = (WebView2Control)GetTemplateChild(webViewTemplateChildName); - StartWebViewCoreIfPossible(); - } - } - - /// - protected override void OnInitialized(EventArgs e) - { - // Called when BeginInit/EndInit are used, such as when creating the control from XAML - base.OnInitialized(e); - StartWebViewCoreIfPossible(); - } - - private void StartWebViewCoreIfPossible() - { - CheckDisposed(); - - if (!RequiredStartupPropertiesSet || _webviewManager != null) - { - return; - } - - // We assume the host page is always in the root of the content directory, because it's - // unclear there's any other use case. We can add more options later if so. - var contentRootDir = Path.GetDirectoryName(Path.GetFullPath(HostPage)); - var hostPageRelativePath = Path.GetRelativePath(contentRootDir, HostPage); - var fileProvider = new PhysicalFileProvider(contentRootDir); - - _webviewManager = new WebView2WebViewManager(new WpfWebView2Wrapper(_webview), Services, WpfDispatcher.Instance, fileProvider, hostPageRelativePath); - foreach (var rootComponent in RootComponents) - { - // Since the page isn't loaded yet, this will always complete synchronously - _ = rootComponent.AddToWebViewManagerAsync(_webviewManager); - } - _webviewManager.Navigate("/"); - } - - private void HandleRootComponentsCollectionChanged(object sender, NotifyCollectionChangedEventArgs eventArgs) - { - CheckDisposed(); - - // If we haven't initialized yet, this is a no-op - if (_webviewManager != null) - { - // Dispatch because this is going to be async, and we want to catch any errors - WpfDispatcher.Instance.InvokeAsync(async () => - { - var newItems = eventArgs.NewItems.Cast(); - var oldItems = eventArgs.OldItems.Cast(); - - foreach (var item in newItems.Except(oldItems)) - { - await item.AddToWebViewManagerAsync(_webviewManager); - } - - foreach (var item in oldItems.Except(newItems)) - { - await item.RemoveFromWebViewManagerAsync(_webviewManager); - } - }); - } - } - - private void Dispose(bool disposing) - { - if (!_isDisposed) - { - if (disposing) - { - // Dispose managed state (managed objects) - _webviewManager?.Dispose(); - _webview?.Dispose(); - } - - // Also: free unmanaged resources (unmanaged objects) and override finalizer - // Also: set large fields to null - _isDisposed = true; - } - } - - /// - /// Performs the final cleanup before the garbage collector destroys the object. - /// - ~BlazorWebView() - { - // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method - Dispose(disposing: false); - } - - /// - /// Releases all resources used by the control. - /// - public void Dispose() - { - // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method - Dispose(disposing: true); - GC.SuppressFinalize(this); - } - - private void CheckDisposed() - { - if (_isDisposed) - { - throw new ObjectDisposedException(GetType().Name); - } - } - } -} diff --git a/src/Components/WebView/Platforms/Wpf/src/Microsoft.AspNetCore.Components.WebView.Wpf.csproj b/src/Components/WebView/Platforms/Wpf/src/Microsoft.AspNetCore.Components.WebView.Wpf.csproj deleted file mode 100644 index 87f347764d0e..000000000000 --- a/src/Components/WebView/Platforms/Wpf/src/Microsoft.AspNetCore.Components.WebView.Wpf.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - - $(DefaultNetCoreTargetFramework)-windows - Build WPF applications with Blazor and WebView2. - true - true - disable - - - - - - - - - diff --git a/src/Components/WebView/Platforms/Wpf/src/PublicAPI.Shipped.txt b/src/Components/WebView/Platforms/Wpf/src/PublicAPI.Shipped.txt deleted file mode 100644 index ab058de62d44..000000000000 --- a/src/Components/WebView/Platforms/Wpf/src/PublicAPI.Shipped.txt +++ /dev/null @@ -1 +0,0 @@ -#nullable enable diff --git a/src/Components/WebView/Platforms/Wpf/src/PublicAPI.Unshipped.txt b/src/Components/WebView/Platforms/Wpf/src/PublicAPI.Unshipped.txt deleted file mode 100644 index 6817de171f4b..000000000000 --- a/src/Components/WebView/Platforms/Wpf/src/PublicAPI.Unshipped.txt +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable -Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView -Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.BlazorWebView() -> void -Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.Dispose() -> void -~Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.HostPage.get -> string -~Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.HostPage.set -> void -~Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.RootComponents.get -> System.Collections.ObjectModel.ObservableCollection -~Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.Services.get -> System.IServiceProvider -~Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.Services.set -> void -Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent -~Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.ComponentType.get -> System.Type -~Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.ComponentType.set -> void -~Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.Parameters.get -> System.Collections.Generic.IDictionary -~Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.Parameters.set -> void -Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.RootComponent() -> void -~Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.Selector.get -> string -~Microsoft.AspNetCore.Components.WebView.Wpf.RootComponent.Selector.set -> void -override Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.OnApplyTemplate() -> void -~static readonly Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.HostPageProperty -> System.Windows.DependencyProperty -~static readonly Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.RootComponentsProperty -> System.Windows.DependencyProperty -~static readonly Microsoft.AspNetCore.Components.WebView.Wpf.BlazorWebView.ServicesProperty -> System.Windows.DependencyProperty diff --git a/src/Components/WebView/Platforms/Wpf/src/RootComponent.cs b/src/Components/WebView/Platforms/Wpf/src/RootComponent.cs deleted file mode 100644 index efac2b40cfca..000000000000 --- a/src/Components/WebView/Platforms/Wpf/src/RootComponent.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Components.WebView.WebView2; - -namespace Microsoft.AspNetCore.Components.WebView.Wpf -{ - /// - /// Describes a root component that can be added to a . - /// - public class RootComponent - { - /// - /// Gets or sets the CSS selector string that specifies where in the document the component should be placed. - /// This must be unique among the root components within the . - /// - public string Selector { get; set; } - - /// - /// Gets or sets the type of the root component. This type must implement . - /// - public Type ComponentType { get; set; } - - /// - /// Gets or sets an optional dictionary of parameters to pass to the root component. - /// - public IDictionary Parameters { get; set; } - - internal Task AddToWebViewManagerAsync(WebViewManager webViewManager) - { - // As a characteristic of XAML,we can't rely on non-default constructors. So we have to - // validate that the required properties were set. We could skip validating this and allow - // the lower-level renderer code to throw, but that would be harder for developers to understand. - - if (string.IsNullOrWhiteSpace(Selector)) - { - throw new InvalidOperationException($"{nameof(RootComponent)} requires a value for its {nameof(Selector)} property, but no value was set."); - } - - if (ComponentType is null) - { - throw new InvalidOperationException($"{nameof(RootComponent)} requires a value for its {nameof(ComponentType)} property, but no value was set."); - } - - var parameterView = Parameters == null ? ParameterView.Empty : ParameterView.FromDictionary(Parameters); - return webViewManager.AddRootComponentAsync(ComponentType, Selector, parameterView); - } - - internal Task RemoveFromWebViewManagerAsync(WebView2WebViewManager webviewManager) - { - return webviewManager.RemoveRootComponentAsync(Selector); - } - } -} diff --git a/src/Components/WebView/Platforms/Wpf/src/WpfCoreWebView2AcceleratorKeyPressedEventArgsWrapper.cs b/src/Components/WebView/Platforms/Wpf/src/WpfCoreWebView2AcceleratorKeyPressedEventArgsWrapper.cs deleted file mode 100644 index 1705677f92d5..000000000000 --- a/src/Components/WebView/Platforms/Wpf/src/WpfCoreWebView2AcceleratorKeyPressedEventArgsWrapper.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using Microsoft.AspNetCore.Components.WebView.WebView2; -using Microsoft.Web.WebView2.Core; - -namespace Microsoft.AspNetCore.Components.WebView.Wpf -{ - internal class WpfCoreWebView2AcceleratorKeyPressedEventArgsWrapper : ICoreWebView2AcceleratorKeyPressedEventArgsWrapper - { - private readonly CoreWebView2AcceleratorKeyPressedEventArgs _eventArgs; - - public WpfCoreWebView2AcceleratorKeyPressedEventArgsWrapper(CoreWebView2AcceleratorKeyPressedEventArgs eventArgs) - { - _eventArgs = eventArgs; - } - public uint VirtualKey => _eventArgs.VirtualKey; - - public int KeyEventLParam => _eventArgs.KeyEventLParam; - - public bool Handled - { - get => _eventArgs.Handled; - set => _eventArgs.Handled = value; - } - } -} diff --git a/src/Components/WebView/Platforms/Wpf/src/WpfCoreWebView2SettingsWrapper.cs b/src/Components/WebView/Platforms/Wpf/src/WpfCoreWebView2SettingsWrapper.cs deleted file mode 100644 index 6e7180d02a16..000000000000 --- a/src/Components/WebView/Platforms/Wpf/src/WpfCoreWebView2SettingsWrapper.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using Microsoft.AspNetCore.Components.WebView.WebView2; -using Microsoft.Web.WebView2.Core; - -namespace Microsoft.AspNetCore.Components.WebView.Wpf -{ - internal class WpfCoreWebView2SettingsWrapper : ICoreWebView2SettingsWrapper - { - private readonly CoreWebView2Settings _settings; - - public WpfCoreWebView2SettingsWrapper(CoreWebView2Settings settings) - { - _settings = settings; - } - - public bool IsScriptEnabled - { - get => _settings.IsScriptEnabled; - set => _settings.IsScriptEnabled = value; - } - public bool IsWebMessageEnabled - { - get => _settings.IsWebMessageEnabled; - set => _settings.IsWebMessageEnabled = value; - } - public bool AreDefaultScriptDialogsEnabled - { - get => _settings.AreDefaultScriptDialogsEnabled; - set => _settings.AreDefaultScriptDialogsEnabled = value; - } - public bool IsStatusBarEnabled - { - get => _settings.IsStatusBarEnabled; - set => _settings.IsStatusBarEnabled = value; - } - public bool AreDevToolsEnabled - { - get => _settings.AreDevToolsEnabled; - set => _settings.AreDevToolsEnabled = value; - } - public bool AreDefaultContextMenusEnabled - { - get => _settings.AreDefaultContextMenusEnabled; - set => _settings.AreDefaultContextMenusEnabled = value; - } - public bool AreHostObjectsAllowed - { - get => _settings.AreHostObjectsAllowed; - set => _settings.AreHostObjectsAllowed = value; - } - public bool IsZoomControlEnabled - { - get => _settings.IsZoomControlEnabled; - set => _settings.IsZoomControlEnabled = value; - } - public bool IsBuiltInErrorPageEnabled - { - get => _settings.IsBuiltInErrorPageEnabled; - set => _settings.IsBuiltInErrorPageEnabled = value; - } - } -} diff --git a/src/Components/WebView/Platforms/Wpf/src/WpfCoreWebView2WebResourceRequestWrapper.cs b/src/Components/WebView/Platforms/Wpf/src/WpfCoreWebView2WebResourceRequestWrapper.cs deleted file mode 100644 index 333508e19180..000000000000 --- a/src/Components/WebView/Platforms/Wpf/src/WpfCoreWebView2WebResourceRequestWrapper.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using Microsoft.AspNetCore.Components.WebView.WebView2; -using Microsoft.Web.WebView2.Core; - -namespace Microsoft.AspNetCore.Components.WebView.Wpf -{ - internal class WpfCoreWebView2WebResourceRequestWrapper : ICoreWebView2WebResourceRequestWrapper - { - private readonly CoreWebView2WebResourceRequestedEventArgs _webResourceRequestedEventArgs; - - public WpfCoreWebView2WebResourceRequestWrapper(CoreWebView2WebResourceRequestedEventArgs webResourceRequestedEventArgs) - { - _webResourceRequestedEventArgs = webResourceRequestedEventArgs; - } - - public string Uri - { - get => _webResourceRequestedEventArgs.Request.Uri; - set => _webResourceRequestedEventArgs.Request.Uri = value; - } - public string Method - { - get => _webResourceRequestedEventArgs.Request.Method; - set => _webResourceRequestedEventArgs.Request.Method = value; - } - } -} diff --git a/src/Components/WebView/Platforms/Wpf/src/WpfCoreWebView2WebResourceRequestedEventArgsWrapper.cs b/src/Components/WebView/Platforms/Wpf/src/WpfCoreWebView2WebResourceRequestedEventArgsWrapper.cs deleted file mode 100644 index ec81295706fd..000000000000 --- a/src/Components/WebView/Platforms/Wpf/src/WpfCoreWebView2WebResourceRequestedEventArgsWrapper.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.IO; -using Microsoft.AspNetCore.Components.WebView.WebView2; -using Microsoft.Web.WebView2.Core; - -namespace Microsoft.AspNetCore.Components.WebView.Wpf -{ - internal class WpfCoreWebView2WebResourceRequestedEventArgsWrapper : ICoreWebView2WebResourceRequestedEventArgsWrapper - { - private readonly CoreWebView2Environment _environment; - private readonly CoreWebView2WebResourceRequestedEventArgs _webResourceRequestedEventArgs; - - public WpfCoreWebView2WebResourceRequestedEventArgsWrapper(CoreWebView2Environment environment, CoreWebView2WebResourceRequestedEventArgs webResourceRequestedEventArgs) - { - _environment = environment; - _webResourceRequestedEventArgs = webResourceRequestedEventArgs; - - Request = new WpfCoreWebView2WebResourceRequestWrapper(webResourceRequestedEventArgs); - ResourceContext = (CoreWebView2WebResourceContextWrapper)webResourceRequestedEventArgs.ResourceContext; - } - - public ICoreWebView2WebResourceRequestWrapper Request { get; } - - public CoreWebView2WebResourceContextWrapper ResourceContext { get; } - - public void SetResponse(Stream content, int statusCode, string statusMessage, string headerString) - { - _webResourceRequestedEventArgs.Response = _environment.CreateWebResourceResponse(content, statusCode, statusMessage, headerString); - } - } -} diff --git a/src/Components/WebView/Platforms/Wpf/src/WpfCoreWebView2Wrapper.cs b/src/Components/WebView/Platforms/Wpf/src/WpfCoreWebView2Wrapper.cs deleted file mode 100644 index 0987823374d4..000000000000 --- a/src/Components/WebView/Platforms/Wpf/src/WpfCoreWebView2Wrapper.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Components.WebView.WebView2; -using Microsoft.Web.WebView2.Core; - -namespace Microsoft.AspNetCore.Components.WebView.Wpf -{ - internal class WpfCoreWebView2Wrapper : ICoreWebView2Wrapper - { - private readonly WpfWebView2Wrapper _webView2; - private WpfCoreWebView2SettingsWrapper _settings; - - public WpfCoreWebView2Wrapper(WpfWebView2Wrapper webView2) - { - if (webView2 is null) - { - throw new ArgumentNullException(nameof(webView2)); - } - - _webView2 = webView2; - } - - public ICoreWebView2SettingsWrapper Settings - { - get - { - if (_settings == null) - { - _settings = new WpfCoreWebView2SettingsWrapper(_webView2.WebView2.CoreWebView2.Settings); - } - return _settings; - } - } - - public Task AddScriptToExecuteOnDocumentCreatedAsync(string javaScript) - { - return _webView2.WebView2.CoreWebView2.AddScriptToExecuteOnDocumentCreatedAsync(javaScript); - } - - public Action AddWebMessageReceivedHandler(Action messageReceivedHandler) - { - void nativeEventHandler(object sender, CoreWebView2WebMessageReceivedEventArgs e) - { - messageReceivedHandler(new WebMessageReceivedEventArgs(e.Source, e.TryGetWebMessageAsString())); - } - - _webView2.WebView2.CoreWebView2.WebMessageReceived += nativeEventHandler; - - // Return removal callback - return () => - { - _webView2.WebView2.CoreWebView2.WebMessageReceived -= nativeEventHandler; - }; - } - - public void AddWebResourceRequestedFilter(string uri, CoreWebView2WebResourceContextWrapper resourceContext) - { - _webView2.WebView2.CoreWebView2.AddWebResourceRequestedFilter(uri, (CoreWebView2WebResourceContext)resourceContext); - } - - public Action AddWebResourceRequestedHandler(EventHandler webResourceRequestedHandler) - { - void nativeEventHandler(object sender, CoreWebView2WebResourceRequestedEventArgs e) - { - webResourceRequestedHandler(_webView2.WebView2, new WpfCoreWebView2WebResourceRequestedEventArgsWrapper(_webView2.Environment, e)); - } - - _webView2.WebView2.CoreWebView2.WebResourceRequested += nativeEventHandler; - - // Return removal callback - return () => - { - _webView2.WebView2.CoreWebView2.WebResourceRequested -= nativeEventHandler; - }; - } - - public void PostWebMessageAsString(string webMessageAsString) - { - _webView2.WebView2.CoreWebView2.PostWebMessageAsString(webMessageAsString); - } - } -} diff --git a/src/Components/WebView/Platforms/Wpf/src/WpfDispatcher.cs b/src/Components/WebView/Platforms/Wpf/src/WpfDispatcher.cs deleted file mode 100644 index 24fa3cb54a71..000000000000 --- a/src/Components/WebView/Platforms/Wpf/src/WpfDispatcher.cs +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Runtime.ExceptionServices; -using System.Threading.Tasks; -using System.Windows; -using WindowsDispatcher = System.Windows.Threading.Dispatcher; - -namespace Microsoft.AspNetCore.Components.WebView.Wpf -{ - internal sealed class WpfDispatcher : Dispatcher - { - private readonly WindowsDispatcher _windowsDispatcher; - - private WpfDispatcher(WindowsDispatcher windowsDispatcher) - { - _windowsDispatcher = windowsDispatcher ?? throw new ArgumentNullException(nameof(windowsDispatcher)); - } - - public static Dispatcher Instance { get; } = new WpfDispatcher(Application.Current.Dispatcher); - - private static Action RethrowException = exception => - ExceptionDispatchInfo.Capture(exception).Throw(); - - public override bool CheckAccess() - => _windowsDispatcher.CheckAccess(); - - public override async Task InvokeAsync(Action workItem) - { - try - { - if (_windowsDispatcher.CheckAccess()) - { - workItem(); - } - else - { - await _windowsDispatcher.InvokeAsync(workItem); - } - } - catch (Exception ex) - { - // TODO: Determine whether this is the right kind of rethrowing pattern - // You do have to do something like this otherwise unhandled exceptions - // throw from inside Dispatcher.InvokeAsync are simply lost. - _ = _windowsDispatcher.BeginInvoke(RethrowException, ex); - throw; - } - } - - public override async Task InvokeAsync(Func workItem) - { - try - { - if (_windowsDispatcher.CheckAccess()) - { - await workItem(); - } - else - { - await _windowsDispatcher.InvokeAsync(workItem); - } - } - catch (Exception ex) - { - // TODO: Determine whether this is the right kind of rethrowing pattern - // You do have to do something like this otherwise unhandled exceptions - // throw from inside Dispatcher.InvokeAsync are simply lost. - _ = _windowsDispatcher.BeginInvoke(RethrowException, ex); - throw; - } - } - - public override async Task InvokeAsync(Func workItem) - { - try - { - if (_windowsDispatcher.CheckAccess()) - { - return workItem(); - } - else - { - return await _windowsDispatcher.InvokeAsync(workItem); - } - } - catch (Exception ex) - { - // TODO: Determine whether this is the right kind of rethrowing pattern - // You do have to do something like this otherwise unhandled exceptions - // throw from inside Dispatcher.InvokeAsync are simply lost. - _ = _windowsDispatcher.BeginInvoke(RethrowException, ex); - throw; - } - } - - public override async Task InvokeAsync(Func> workItem) - { - try - { - if (_windowsDispatcher.CheckAccess()) - { - return await workItem(); - } - else - { - return await _windowsDispatcher.InvokeAsync(workItem).Task.Unwrap(); - } - } - catch (Exception ex) - { - // TODO: Determine whether this is the right kind of rethrowing pattern - // You do have to do something like this otherwise unhandled exceptions - // throw from inside Dispatcher.InvokeAsync are simply lost. - _ = _windowsDispatcher.BeginInvoke(RethrowException, ex); - throw; - } - } - } -} diff --git a/src/Components/WebView/Platforms/Wpf/src/WpfWebView2Wrapper.cs b/src/Components/WebView/Platforms/Wpf/src/WpfWebView2Wrapper.cs deleted file mode 100644 index 226f30e30b7a..000000000000 --- a/src/Components/WebView/Platforms/Wpf/src/WpfWebView2Wrapper.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Components.WebView.WebView2; -using Microsoft.Web.WebView2.Core; -using WebView2Control = Microsoft.Web.WebView2.Wpf.WebView2; - -namespace Microsoft.AspNetCore.Components.WebView.Wpf -{ - internal class WpfWebView2Wrapper : IWebView2Wrapper - { - private readonly WpfCoreWebView2Wrapper _coreWebView2Wrapper; - - public WpfWebView2Wrapper(WebView2Control webView2) - { - if (webView2 is null) - { - throw new ArgumentNullException(nameof(webView2)); - } - - WebView2 = webView2; - _coreWebView2Wrapper = new WpfCoreWebView2Wrapper(this); - } - - public ICoreWebView2Wrapper CoreWebView2 => _coreWebView2Wrapper; - - public Uri Source - { - get => WebView2.Source; - set => WebView2.Source = value; - } - - public WebView2Control WebView2 { get; } - - public CoreWebView2Environment Environment { get; set; } - - public Action AddAcceleratorKeyPressedHandler(EventHandler eventHandler) - { - EventHandler realHandler = (object sender, CoreWebView2AcceleratorKeyPressedEventArgs e) => - { - eventHandler(WebView2, new WpfCoreWebView2AcceleratorKeyPressedEventArgsWrapper(e)); - }; - WebView2.AcceleratorKeyPressed += realHandler; - - // Return removal callback - return () => { WebView2.AcceleratorKeyPressed -= realHandler; }; - } - - public async Task CreateEnvironmentAsync() - { - Environment = await CoreWebView2Environment.CreateAsync(); - } - - public Task EnsureCoreWebView2Async() - { - return WebView2.EnsureCoreWebView2Async(Environment); - } - } -} diff --git a/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/App.xaml b/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/App.xaml deleted file mode 100644 index cad35b7bac57..000000000000 --- a/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/App.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - diff --git a/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/App.xaml.cs b/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/App.xaml.cs deleted file mode 100644 index eac6a97a4c60..000000000000 --- a/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/App.xaml.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Windows; - -namespace WpfTestApp -{ - /// - /// Interaction logic for App.xaml - /// - public partial class App : Application - { - private void Application_Startup(object sender, StartupEventArgs e) - { - AppDomain.CurrentDomain.UnhandledException += (sender, error) => - { - MessageBox.Show(error.ExceptionObject.ToString(), "Error", MessageBoxButton.OK, MessageBoxImage.Error); - }; - } - } -} diff --git a/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/MainWindow.xaml b/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/MainWindow.xaml deleted file mode 100644 index 1b75505a67eb..000000000000 --- a/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/MainWindow.xaml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - diff --git a/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/MainWindow.xaml.cs b/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/MainWindow.xaml.cs deleted file mode 100644 index 09b5b884d6b5..000000000000 --- a/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/MainWindow.xaml.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Net.Http; -using System.Windows; -using Microsoft.Extensions.DependencyInjection; - -namespace WpfTestApp -{ - /// - /// Interaction logic for MainWindow.xaml - /// - public partial class MainWindow : Window - { - public MainWindow() - { - var serviceCollection = new ServiceCollection(); - serviceCollection.AddBlazorWebView(); - serviceCollection.AddSingleton(); - Resources.Add("services", serviceCollection.BuildServiceProvider()); - - InitializeComponent(); - } - } -} diff --git a/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/WpfTestApp.csproj b/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/WpfTestApp.csproj deleted file mode 100644 index 267680d6043d..000000000000 --- a/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/WpfTestApp.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - $(DefaultNetCoreTargetFramework)-windows - WinExe - true - false - - - - - - - - - - - - - PreserveNewest - - - - diff --git a/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/wwwroot/css/app.css b/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/wwwroot/css/app.css deleted file mode 100644 index 5053cb6b080c..000000000000 --- a/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/wwwroot/css/app.css +++ /dev/null @@ -1,26 +0,0 @@ -#blazor-error-ui { - background: lightyellow; - bottom: 0; - box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); - display: none; - left: 0; - padding: 0.6rem 1.25rem 0.7rem 1.25rem; - position: fixed; - width: 100%; - z-index: 1000; -} - -#blazor-error-ui .dismiss { - cursor: pointer; - position: absolute; - right: 0.75rem; - top: 0.5rem; -} - -.valid.modified:not([type=checkbox]) { - outline: 1px solid #26b050; -} - -.invalid { - outline: 1px solid red; -} diff --git a/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/wwwroot/webviewhost.html b/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/wwwroot/webviewhost.html deleted file mode 100644 index 4ea1598a893d..000000000000 --- a/src/Components/WebView/Platforms/Wpf/testassets/WpfTestApp/wwwroot/webviewhost.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - WinFormsTestApp - - - - - - - - - - - - - - Loading... - - - - - - - - - - - - - - - - - - diff --git a/src/Components/WebView/Samples/BlazorWinFormsApp/AppState.cs b/src/Components/WebView/Samples/BlazorWinFormsApp/AppState.cs deleted file mode 100644 index 09993ac215fb..000000000000 --- a/src/Components/WebView/Samples/BlazorWinFormsApp/AppState.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace BlazorWinFormsApp -{ - public class AppState - { - public int Counter { get; set; } - } -} diff --git a/src/Components/WebView/Samples/BlazorWinFormsApp/BlazorWinFormsApp.csproj b/src/Components/WebView/Samples/BlazorWinFormsApp/BlazorWinFormsApp.csproj deleted file mode 100644 index 46a1aaa75786..000000000000 --- a/src/Components/WebView/Samples/BlazorWinFormsApp/BlazorWinFormsApp.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - $(DefaultNetCoreTargetFramework)-windows - WinExe - true - false - - - - - - - - - - - - - PreserveNewest - - - - diff --git a/src/Components/WebView/Samples/BlazorWinFormsApp/Form1.cs b/src/Components/WebView/Samples/BlazorWinFormsApp/Form1.cs deleted file mode 100644 index 5bcfe71ab7a6..000000000000 --- a/src/Components/WebView/Samples/BlazorWinFormsApp/Form1.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Windows.Forms; -using Microsoft.AspNetCore.Components.WebView.WindowsForms; -using Microsoft.Extensions.DependencyInjection; - -namespace BlazorWinFormsApp -{ - public partial class Form1 : Form - { - private readonly AppState _appState = new(); - - public Form1() - { - var serviceCollection = new ServiceCollection(); - serviceCollection.AddBlazorWebView(); - serviceCollection.AddSingleton(_appState); - InitializeComponent(); - - blazorWebView1.HostPage = @"wwwroot\index.html"; - blazorWebView1.Services = serviceCollection.BuildServiceProvider(); - blazorWebView1.RootComponents.Add
("#app"); - } - - private void button1_Click(object sender, EventArgs e) - { - MessageBox.Show( - owner: this, - text: $"Current counter value is: {_appState.Counter}", - caption: "Counter"); - } - } -} diff --git a/src/Components/WebView/Samples/BlazorWinFormsApp/Form1.designer.cs b/src/Components/WebView/Samples/BlazorWinFormsApp/Form1.designer.cs deleted file mode 100644 index 37369dbe44dc..000000000000 --- a/src/Components/WebView/Samples/BlazorWinFormsApp/Form1.designer.cs +++ /dev/null @@ -1,102 +0,0 @@ -namespace BlazorWinFormsApp -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.label1 = new System.Windows.Forms.Label(); - this.button1 = new System.Windows.Forms.Button(); - this.blazorWebView1 = new Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView(); - this.groupBox1.SuspendLayout(); - this.SuspendLayout(); - // - // groupBox1 - // - this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox1.Controls.Add(this.label1); - this.groupBox1.Controls.Add(this.button1); - this.groupBox1.Location = new System.Drawing.Point(13, 13); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(775, 162); - this.groupBox1.TabIndex = 10; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Native Windows Forms UI"; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(28, 68); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(157, 32); - this.label1.TabIndex = 10; - this.label1.Text = "This is a label"; - // - // button1 - // - this.button1.Location = new System.Drawing.Point(364, 68); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(342, 46); - this.button1.TabIndex = 20; - this.button1.Text = "&Click to see counter value"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // blazorWebView1 - // - this.blazorWebView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.blazorWebView1.Location = new System.Drawing.Point(13, 181); - this.blazorWebView1.Name = "blazorWebView1"; - this.blazorWebView1.Size = new System.Drawing.Size(775, 257); - this.blazorWebView1.TabIndex = 20; - // - // Form1 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(13F, 32F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Controls.Add(this.blazorWebView1); - this.Controls.Add(this.groupBox1); - this.Name = "Form1"; - this.Text = "Blazor Web in Windows Forms"; - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Button button1; - private Microsoft.AspNetCore.Components.WebView.WindowsForms.BlazorWebView blazorWebView1; - } -} diff --git a/src/Components/WebView/Samples/BlazorWinFormsApp/Main.razor b/src/Components/WebView/Samples/BlazorWinFormsApp/Main.razor deleted file mode 100644 index 1d31f12420a5..000000000000 --- a/src/Components/WebView/Samples/BlazorWinFormsApp/Main.razor +++ /dev/null @@ -1,12 +0,0 @@ - - - Home | - Other -
- -
- -

Not found

-

Sorry, there's nothing here.

-
-
diff --git a/src/Components/WebView/Samples/BlazorWinFormsApp/Pages/Index.razor b/src/Components/WebView/Samples/BlazorWinFormsApp/Pages/Index.razor deleted file mode 100644 index ef4c042ed3ce..000000000000 --- a/src/Components/WebView/Samples/BlazorWinFormsApp/Pages/Index.razor +++ /dev/null @@ -1,25 +0,0 @@ -@page "/" -@inject AppState AppState -@using WebviewAppShared - -

Hello, world!

- -

The current count is @AppState.Counter

- - - - -

This is a shared component

- - -@code { - void IncrementCount() - { - AppState.Counter++; - } - - void TriggerException() - { - throw new InvalidTimeZoneException("This is an exception from an event handler"); - } -} diff --git a/src/Components/WebView/Samples/BlazorWinFormsApp/Pages/Other.razor b/src/Components/WebView/Samples/BlazorWinFormsApp/Pages/Other.razor deleted file mode 100644 index a840a595f9a9..000000000000 --- a/src/Components/WebView/Samples/BlazorWinFormsApp/Pages/Other.razor +++ /dev/null @@ -1,13 +0,0 @@ -@page "/other" -@inject NavigationManager NavigationManager - -Here is another page. Looks like navigation works. - - - -@code { - void BackToHome() - { - NavigationManager.NavigateTo(""); - } -} diff --git a/src/Components/WebView/Samples/BlazorWinFormsApp/Program.cs b/src/Components/WebView/Samples/BlazorWinFormsApp/Program.cs deleted file mode 100644 index bf14982f3db1..000000000000 --- a/src/Components/WebView/Samples/BlazorWinFormsApp/Program.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace BlazorWinFormsApp -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - AppDomain.CurrentDomain.UnhandledException += (sender, error) => - { - MessageBox.Show(text: error.ExceptionObject.ToString(), caption: "Error"); - }; - - Application.SetHighDpiMode(HighDpiMode.SystemAware); - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); - } - } -} diff --git a/src/Components/WebView/Samples/BlazorWinFormsApp/_Imports.razor b/src/Components/WebView/Samples/BlazorWinFormsApp/_Imports.razor deleted file mode 100644 index 6ba5da5dbac6..000000000000 --- a/src/Components/WebView/Samples/BlazorWinFormsApp/_Imports.razor +++ /dev/null @@ -1,7 +0,0 @@ -@using System.Net.Http -@using System.Net.Http.Json -@using Microsoft.AspNetCore.Components.Forms -@using Microsoft.AspNetCore.Components.Routing -@using Microsoft.AspNetCore.Components.Web -@using Microsoft.AspNetCore.Components.Web.Virtualization -@using Microsoft.JSInterop diff --git a/src/Components/WebView/Samples/BlazorWinFormsApp/wwwroot/css/app.css b/src/Components/WebView/Samples/BlazorWinFormsApp/wwwroot/css/app.css deleted file mode 100644 index 4f895ce71e4d..000000000000 --- a/src/Components/WebView/Samples/BlazorWinFormsApp/wwwroot/css/app.css +++ /dev/null @@ -1,18 +0,0 @@ -#blazor-error-ui { - background: lightyellow; - bottom: 0; - box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); - display: none; - left: 0; - padding: 0.6rem 1.25rem 0.7rem 1.25rem; - position: fixed; - width: 100%; - z-index: 1000; -} - -#blazor-error-ui .dismiss { - cursor: pointer; - position: absolute; - right: 0.75rem; - top: 0.5rem; -} diff --git a/src/Components/WebView/Samples/BlazorWinFormsApp/wwwroot/index.html b/src/Components/WebView/Samples/BlazorWinFormsApp/wwwroot/index.html deleted file mode 100644 index 228867852716..000000000000 --- a/src/Components/WebView/Samples/BlazorWinFormsApp/wwwroot/index.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - Blazor WinForms app - - - - - - -
- -
- An unhandled error has occurred. - Reload - 🗙 -
- - - - - diff --git a/src/Components/WebView/Samples/BlazorWpfApp/App.xaml b/src/Components/WebView/Samples/BlazorWpfApp/App.xaml deleted file mode 100644 index 7cf33e4771f6..000000000000 --- a/src/Components/WebView/Samples/BlazorWpfApp/App.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - diff --git a/src/Components/WebView/Samples/BlazorWpfApp/App.xaml.cs b/src/Components/WebView/Samples/BlazorWpfApp/App.xaml.cs deleted file mode 100644 index 69a54128c91c..000000000000 --- a/src/Components/WebView/Samples/BlazorWpfApp/App.xaml.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Windows; - -namespace BlazorWpfApp -{ - /// - /// Interaction logic for App.xaml - /// - public partial class App : Application - { - private void Application_Startup(object sender, StartupEventArgs e) - { - AppDomain.CurrentDomain.UnhandledException += (sender, error) => - { - MessageBox.Show(error.ExceptionObject.ToString(), "Error", MessageBoxButton.OK, MessageBoxImage.Error); - }; - } - } -} diff --git a/src/Components/WebView/Samples/BlazorWpfApp/AppState.cs b/src/Components/WebView/Samples/BlazorWpfApp/AppState.cs deleted file mode 100644 index 019ef33abfa5..000000000000 --- a/src/Components/WebView/Samples/BlazorWpfApp/AppState.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace BlazorWpfApp -{ - public class AppState - { - public int Counter { get; set; } - } -} diff --git a/src/Components/WebView/Samples/BlazorWpfApp/BlazorWpfApp.csproj b/src/Components/WebView/Samples/BlazorWpfApp/BlazorWpfApp.csproj deleted file mode 100644 index 093ee74f7c66..000000000000 --- a/src/Components/WebView/Samples/BlazorWpfApp/BlazorWpfApp.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - $(DefaultNetCoreTargetFramework)-windows - WinExe - true - false - - - - - - - - - - - - - PreserveNewest - - - - diff --git a/src/Components/WebView/Samples/BlazorWpfApp/Main.razor b/src/Components/WebView/Samples/BlazorWpfApp/Main.razor deleted file mode 100644 index 1d31f12420a5..000000000000 --- a/src/Components/WebView/Samples/BlazorWpfApp/Main.razor +++ /dev/null @@ -1,12 +0,0 @@ - - - Home | - Other -
- -
- -

Not found

-

Sorry, there's nothing here.

-
-
diff --git a/src/Components/WebView/Samples/BlazorWpfApp/MainWindow.xaml b/src/Components/WebView/Samples/BlazorWpfApp/MainWindow.xaml deleted file mode 100644 index 1b30e33b856e..000000000000 --- a/src/Components/WebView/Samples/BlazorWpfApp/MainWindow.xaml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - diff --git a/src/Components/WebView/Samples/BlazorWpfApp/MainWindow.xaml.cs b/src/Components/WebView/Samples/BlazorWpfApp/MainWindow.xaml.cs deleted file mode 100644 index 14fdc206ec7c..000000000000 --- a/src/Components/WebView/Samples/BlazorWpfApp/MainWindow.xaml.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Windows; -using Microsoft.Extensions.DependencyInjection; - -namespace BlazorWpfApp -{ - /// - /// Interaction logic for MainWindow.xaml - /// - public partial class MainWindow : Window - { - private readonly AppState _appState = new(); - - public MainWindow() - { - var serviceCollection = new ServiceCollection(); - serviceCollection.AddBlazorWebView(); - serviceCollection.AddSingleton(_appState); - Resources.Add("services", serviceCollection.BuildServiceProvider()); - - InitializeComponent(); - } - - private void Button_Click(object sender, RoutedEventArgs e) - { - MessageBox.Show( - owner: this, - messageBoxText: $"Current counter value is: {_appState.Counter}", - caption: "Counter"); - } - } - - // Workaround for compiler error "error MC3050: Cannot find the type 'local:Main'" - // It seems that, although WPF's design-time build can see Razor components, its runtime build cannot. - public partial class Main { } -} diff --git a/src/Components/WebView/Samples/BlazorWpfApp/Pages/Index.razor b/src/Components/WebView/Samples/BlazorWpfApp/Pages/Index.razor deleted file mode 100644 index 499d798b9bd4..000000000000 --- a/src/Components/WebView/Samples/BlazorWpfApp/Pages/Index.razor +++ /dev/null @@ -1,26 +0,0 @@ -@page "/" -@using WebviewAppShared -@* NOTE: The full namespace is included here to work around this bug: https://github.com/dotnet/aspnetcore/issues/30851 *@ -@inject BlazorWpfApp.AppState AppState - -

Hello, world!

- -

The current count is @AppState.Counter

- - - - -

This is a shared component

- - -@code { - void IncrementCount() - { - AppState.Counter++; - } - - void TriggerException() - { - throw new InvalidTimeZoneException("This is an exception from an event handler"); - } -} diff --git a/src/Components/WebView/Samples/BlazorWpfApp/Pages/Other.razor b/src/Components/WebView/Samples/BlazorWpfApp/Pages/Other.razor deleted file mode 100644 index a840a595f9a9..000000000000 --- a/src/Components/WebView/Samples/BlazorWpfApp/Pages/Other.razor +++ /dev/null @@ -1,13 +0,0 @@ -@page "/other" -@inject NavigationManager NavigationManager - -Here is another page. Looks like navigation works. - - - -@code { - void BackToHome() - { - NavigationManager.NavigateTo(""); - } -} diff --git a/src/Components/WebView/Samples/BlazorWpfApp/_Imports.razor b/src/Components/WebView/Samples/BlazorWpfApp/_Imports.razor deleted file mode 100644 index 6ba5da5dbac6..000000000000 --- a/src/Components/WebView/Samples/BlazorWpfApp/_Imports.razor +++ /dev/null @@ -1,7 +0,0 @@ -@using System.Net.Http -@using System.Net.Http.Json -@using Microsoft.AspNetCore.Components.Forms -@using Microsoft.AspNetCore.Components.Routing -@using Microsoft.AspNetCore.Components.Web -@using Microsoft.AspNetCore.Components.Web.Virtualization -@using Microsoft.JSInterop diff --git a/src/Components/WebView/Samples/BlazorWpfApp/wwwroot/css/app.css b/src/Components/WebView/Samples/BlazorWpfApp/wwwroot/css/app.css deleted file mode 100644 index 4f895ce71e4d..000000000000 --- a/src/Components/WebView/Samples/BlazorWpfApp/wwwroot/css/app.css +++ /dev/null @@ -1,18 +0,0 @@ -#blazor-error-ui { - background: lightyellow; - bottom: 0; - box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); - display: none; - left: 0; - padding: 0.6rem 1.25rem 0.7rem 1.25rem; - position: fixed; - width: 100%; - z-index: 1000; -} - -#blazor-error-ui .dismiss { - cursor: pointer; - position: absolute; - right: 0.75rem; - top: 0.5rem; -} diff --git a/src/Components/WebView/Samples/BlazorWpfApp/wwwroot/index.html b/src/Components/WebView/Samples/BlazorWpfApp/wwwroot/index.html deleted file mode 100644 index 3887aef9712e..000000000000 --- a/src/Components/WebView/Samples/BlazorWpfApp/wwwroot/index.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - Blazor WPF app - - - - - - -
- -
- An unhandled error has occurred. - Reload - 🗙 -
- - - - - diff --git a/src/Components/WebView/Samples/WebviewAppShared/ExampleJsInterop.cs b/src/Components/WebView/Samples/WebviewAppShared/ExampleJsInterop.cs deleted file mode 100644 index e4f19d8ccce7..000000000000 --- a/src/Components/WebView/Samples/WebviewAppShared/ExampleJsInterop.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.JSInterop; -using System; -using System.Threading.Tasks; - -namespace WebviewAppShared -{ - // This class provides an example of how JavaScript functionality can be wrapped - // in a .NET class for easy consumption. The associated JavaScript module is - // loaded on demand when first needed. - // - // This class can be registered as scoped DI service and then injected into Blazor - // components for use. - - public class ExampleJsInterop : IAsyncDisposable - { - private readonly Lazy> moduleTask; - - public ExampleJsInterop(IJSRuntime jsRuntime) - { - moduleTask = new(() => jsRuntime.InvokeAsync( - "import", "./_content/WebviewAppShared/exampleJsInterop.js").AsTask()); - } - - public async ValueTask Prompt(string message) - { - var module = await moduleTask.Value; - return await module.InvokeAsync("showPrompt", message); - } - - public async ValueTask DisposeAsync() - { - if (moduleTask.IsValueCreated) - { - var module = await moduleTask.Value; - await module.DisposeAsync(); - } - } - } -} diff --git a/src/Components/WebView/Samples/WebviewAppShared/SharedComponent.razor b/src/Components/WebView/Samples/WebviewAppShared/SharedComponent.razor deleted file mode 100644 index 4041aa40a4d5..000000000000 --- a/src/Components/WebView/Samples/WebviewAppShared/SharedComponent.razor +++ /dev/null @@ -1,3 +0,0 @@ -
- This component is defined in the WebviewAppShared package. -
diff --git a/src/Components/WebView/Samples/WebviewAppShared/SharedComponent.razor.css b/src/Components/WebView/Samples/WebviewAppShared/SharedComponent.razor.css deleted file mode 100644 index c6afca404296..000000000000 --- a/src/Components/WebView/Samples/WebviewAppShared/SharedComponent.razor.css +++ /dev/null @@ -1,6 +0,0 @@ -.my-component { - border: 2px dashed red; - padding: 1em; - margin: 1em 0; - background-image: url('background.png'); -} diff --git a/src/Components/WebView/Samples/WebviewAppShared/WebviewAppShared.csproj b/src/Components/WebView/Samples/WebviewAppShared/WebviewAppShared.csproj deleted file mode 100644 index 6836c303c123..000000000000 --- a/src/Components/WebView/Samples/WebviewAppShared/WebviewAppShared.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - $(DefaultNetCoreTargetFramework) - - - - - - - - - - - - diff --git a/src/Components/WebView/Samples/WebviewAppShared/_Imports.razor b/src/Components/WebView/Samples/WebviewAppShared/_Imports.razor deleted file mode 100644 index 77285129dabe..000000000000 --- a/src/Components/WebView/Samples/WebviewAppShared/_Imports.razor +++ /dev/null @@ -1 +0,0 @@ -@using Microsoft.AspNetCore.Components.Web diff --git a/src/Components/WebView/Samples/WebviewAppShared/wwwroot/background.png b/src/Components/WebView/Samples/WebviewAppShared/wwwroot/background.png deleted file mode 100644 index e15a3bde6e2b..000000000000 Binary files a/src/Components/WebView/Samples/WebviewAppShared/wwwroot/background.png and /dev/null differ diff --git a/src/Components/WebView/Samples/WebviewAppShared/wwwroot/exampleJsInterop.js b/src/Components/WebView/Samples/WebviewAppShared/wwwroot/exampleJsInterop.js deleted file mode 100644 index ea8d76ad2d12..000000000000 --- a/src/Components/WebView/Samples/WebviewAppShared/wwwroot/exampleJsInterop.js +++ /dev/null @@ -1,6 +0,0 @@ -// This is a JavaScript module that is loaded on demand. It can export any number of -// functions, and may import other JavaScript modules if required. - -export function showPrompt(message) { - return prompt(message, 'Type anything here'); -}