Skip to content

Conversation

@StephaneDelcroix
Copy link
Contributor

@StephaneDelcroix StephaneDelcroix commented Apr 14, 2025

Description of Change

Allow aggregating multiple xmlns into a single new global http://schemas.microsoft.com/dotnet/maui/global using XmlnsDefinition attribute, like this

[assembly: XmlnsDefinition("http://schemas.microsoft.com/dotnet/maui/global", "http://schemas.microsoft.com/dotnet/2021/maui")]

the x: xmlns can not be aggregated, as it serves important purposes for the parsers

this also brings #28090 to fix #28150

It uses a source generator, so this change is transparent to anyone consuming maui XAML, including tooling

Issues Fixed

Copilot AI review requested due to automatic review settings April 14, 2025 10:00
@StephaneDelcroix StephaneDelcroix requested a review from a team as a code owner April 14, 2025 10:00
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.

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

Files not reviewed (3)
  • src/Controls/docs/Microsoft.Maui.Controls/XmlnsDefinitionAttribute.xml: Language not supported
  • src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Shipped.txt: Language not supported
  • src/Controls/src/Core/PublicAPI/net/PublicAPI.Shipped.txt: Language not supported

/// <include file="../../docs/Microsoft.Maui.Controls/XmlnsDefinitionAttribute.xml" path="//Member[@MemberName='AssemblyName']/Docs/*" />
public string AssemblyName { get; set; }
//TODO we need an analyzer to check before runtime
if (target == "http://schemas.microsoft.com/winfx/2009/xaml" || target == "http://schemas.microsoft.com/winfx/2006/xaml")
Copy link

Copilot AI Apr 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The XmlnsDefinitionAttribute constructor now uses a 'target' parameter instead of 'clrNamespace', which is a breaking change. Please verify that all consumers are updated accordingly and that the documentation and tests reflect this change.

Copilot uses AI. Check for mistakes.
@StephaneDelcroix StephaneDelcroix force-pushed the dev/stdelc/xmlnsaggregation branch from 21c132f to 2856e87 Compare April 24, 2025 15:02
@PureWeen PureWeen added this to the .NET 9 SR8 milestone May 8, 2025
@PureWeen PureWeen moved this from Todo to Ready To Review in MAUI SDK Ongoing May 8, 2025
@StephaneDelcroix StephaneDelcroix force-pushed the dev/stdelc/xmlnsaggregation branch 2 times, most recently from 6de9a5d to ec71e64 Compare May 19, 2025 10:29
Allow aggregating multiple xmlns into a single new global
http://schemas.microsoft.com/dotnet/maui/global using XmlnsDefinition
attribute, like this

```csharp
[assembly: XmlnsDefinition("http://schemas.microsoft.com/dotnet/maui/global", "http://schemas.microsoft.com/dotnet/2021/maui")]
```

the x: xmlns can not be aggregated, as it serves important purposes for
the parsers

this also brings #28090 to fix #28150

- fixes #28150
- fixes #28843
- closes #28090
@StephaneDelcroix
Copy link
Contributor Author

closing in favour of #29579

@github-project-automation github-project-automation bot moved this from Ready To Review to Done in MAUI SDK Ongoing May 19, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jun 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

xmlns aggregation XmlnsDefinitonAttribute is not supported for "this" assembly

3 participants