Skip to content

Conversation

@mattleibow
Copy link
Member

This pull request updates the Blazor WPF integration to use the newer WebView2CompositionControl instead of the older WebView2 control. 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:

  • Updated all control type aliases from WebView2 to WebView2CompositionControl in shared source files, WPF-specific files, and event argument definitions (BlazorWebViewInitializedEventArgs.cs, WebView2WebViewManager.cs, BlazorWebView.cs). [1] [2] [3]
  • Changed public API surface in PublicAPI.Unshipped.txt to reflect the new control type, including removal of old getter signatures and addition of new ones for WebView properties.

Project configuration update:

  • Modified the target framework in BlazorWpfApp.csproj to specify windows10.0.17763.0, ensuring compatibility with the new control and platform requirements.

This removes the airspace issues.

This is a breaking change.

Fixes #28063
Copilot AI review requested due to automatic review settings September 25, 2025 23:15
Copy link
Contributor

Copilot AI left a 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>
Copy link

Copilot AI Sep 25, 2025

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.
@rmarinho
Copy link
Member

/backport to release/10.0.1xx-rc2

@github-actions
Copy link
Contributor

Started backporting to release/10.0.1xx-rc2: https://github.com/dotnet/maui/actions/runs/18038618639

@rmarinho rmarinho merged commit 1273c63 into net10.0 Sep 27, 2025
151 of 153 checks passed
@rmarinho rmarinho deleted the dev/blazor-wpf-composite branch September 27, 2025 15:06
@PureWeen PureWeen mentioned this pull request Oct 21, 2025
2 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants