Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 12, 2025

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description of Change

The IMauiHandlersFactory.GetHandler API now requires an IMauiContext parameter for handler resolution. Updated all test methods in HostBuilderHandlerTests.cs to create and pass the required context:

var mauiHandlersFactory = mauiApp.Services.GetRequiredService<IMauiHandlersFactory>();
var context = new HandlersContextStub(mauiApp.Services);

// Now requires context parameter
var handler = mauiHandlersFactory.GetHandler<IViewStub>(context);
var handler = mauiHandlersFactory.GetHandler(typeof(IViewStub), context);

Changes:

  • Added IMauiContext instantiation via HandlersContextStub in all affected test methods
  • Updated 11 test methods to pass context to GetHandler calls

All 23 tests in HostBuilderHandlerTests now pass with the updated handler resolution API.

Issues Fixed

Part of #29952 - net11.0 branch build failures after ElementHandlerAttribute changes.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Update built-in visual elements to use ElementHandlerAttribute Fix HostBuilderHandlerTests for net11.0 IMauiContext parameter requirement Dec 12, 2025
Copilot AI requested a review from simonrozsival December 12, 2025 14:34
@simonrozsival simonrozsival marked this pull request as ready for review December 12, 2025 16:42
@simonrozsival simonrozsival merged commit ee44963 into dev/simonrozsival/net10.0-use-element-handler-attributes Dec 12, 2025
4 of 5 checks passed
@simonrozsival simonrozsival deleted the copilot/sub-pr-29952-again branch December 12, 2025 16:42
@github-actions github-actions bot locked and limited conversation to collaborators Jan 12, 2026
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.

2 participants