-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Use the WebView2CompositionControl in Blazor WPF #31777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This removes the airspace issues. This is a breaking change. Fixes #28063
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates the Blazor WPF integration from the legacy WebView2 control to the newer WebView2CompositionControl to improve compatibility and features.
- Updates all type aliases across shared source files to use
WebView2CompositionControl - Updates public API surface to reflect the new control type
- Modifies sample project target framework to ensure compatibility with the new control
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/BlazorWebView/src/Wpf/PublicAPI.Unshipped.txt | Updates public API definitions to reflect WebView2CompositionControl migration |
| src/BlazorWebView/src/Wpf/BlazorWebView.cs | Changes WebView2Control alias from WebView2 to WebView2CompositionControl |
| src/BlazorWebView/src/SharedSource/WebView2WebViewManager.cs | Updates WebView2Control type alias for WPF platform |
| src/BlazorWebView/src/SharedSource/BlazorWebViewInitializedEventArgs.cs | Changes WebView2Control alias in event args for WPF |
| src/BlazorWebView/samples/BlazorWpfApp/BlazorWpfApp.csproj | Updates target framework to specify Windows 10.0.17763.0 compatibility |
|
|
||
| <PropertyGroup> | ||
| <TargetFrameworks>$(_MauiDotNetTfm)-windows</TargetFrameworks> | ||
| <TargetFramework>$(_MauiDotNetTfm)-windows10.0.17763.0</TargetFramework> |
Copilot
AI
Sep 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change modifies the target framework from TargetFrameworks (plural) to TargetFramework (singular) and adds a specific Windows version requirement. This could be a breaking change for consumers who were previously able to target multiple frameworks or older Windows versions. Please alert reviewers that this is potentially a breaking change.
Copilot uses AI. Check for mistakes.
|
/backport to release/10.0.1xx-rc2 |
|
Started backporting to release/10.0.1xx-rc2: https://github.com/dotnet/maui/actions/runs/18038618639 |
This pull request updates the Blazor WPF integration to use the newer
WebView2CompositionControlinstead of the olderWebView2control. This change affects multiple files and public APIs, reflecting a platform-wide migration to the new control for improved compatibility and features.Migration to
WebView2CompositionControl:WebView2toWebView2CompositionControlin shared source files, WPF-specific files, and event argument definitions (BlazorWebViewInitializedEventArgs.cs,WebView2WebViewManager.cs,BlazorWebView.cs). [1] [2] [3]PublicAPI.Unshipped.txtto reflect the new control type, including removal of old getter signatures and addition of new ones forWebViewproperties.Project configuration update:
BlazorWpfApp.csprojto specifywindows10.0.17763.0, ensuring compatibility with the new control and platform requirements.