Skip to content

Conversation

@StephaneDelcroix
Copy link
Contributor

Description of Change

resolve type in the right xmlns for visual state targets

Issues Fixed

Copilot AI review requested due to automatic review settings August 19, 2025 11:27
@StephaneDelcroix StephaneDelcroix requested a review from a team as a code owner August 19, 2025 11:27
@PureWeen PureWeen added this to the .NET 10.0-rc1 milestone Aug 19, 2025
@PureWeen PureWeen moved this to Ready To Review in MAUI SDK Ongoing Aug 19, 2025
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 fixes XML namespace (xmlns) resolution issues when compiling XAML with the source generator, specifically for visual state targets. The fix ensures that type resolution considers the correct namespace context when resolving types in visual state setters.

  • Updates the BindablePropertyConverter to properly handle XmlType objects instead of string type names
  • Modifies NodeSGExtensions to use XmlType for type resolution in source generation context
  • Adds comprehensive test coverage for the xmlns resolution scenario

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Controls/tests/Xaml.UnitTests/Issues/Maui31186.xaml Test XAML file demonstrating visual state with custom button type using local xmlns
src/Controls/tests/Xaml.UnitTests/Issues/Maui31186.xaml.cs Unit test validating xmlns resolution for visual state targets works in both runtime and source generation scenarios
src/Controls/src/SourceGen/NodeSGExtensions.cs Updates GetBindablePropertyTarget method to use XmlType instead of string for proper namespace resolution
src/Controls/src/Build.Tasks/XmlTypeExtensions.cs Minor whitespace formatting fix
src/Controls/src/Build.Tasks/XamlCache.cs Method name correction from GetXmlsDefinitions to GetXmlnsDefinitions
src/Controls/src/Build.Tasks/CompiledConverters/BindablePropertyConverter.cs Major refactoring to use XmlType objects throughout for proper namespace-aware type resolution

@PureWeen PureWeen added the p/0 Work that we can't release without label Aug 19, 2025
@rmarinho
Copy link
Member

/backport to release/10.0.1xx-rc1

@github-actions
Copy link
Contributor

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

@jfversluis jfversluis merged commit e2cf752 into net10.0 Aug 20, 2025
148 checks passed
@jfversluis jfversluis deleted the dev/stdelc/fix31186 branch August 20, 2025 08:36
@github-project-automation github-project-automation bot moved this from Approved to Done in MAUI SDK Ongoing Aug 20, 2025
jfversluis added a commit that referenced this pull request Aug 20, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

p/0 Work that we can't release without

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants