Skip to content

XAML xmlns simplifications #28836

@StephaneDelcroix

Description

@StephaneDelcroix

This is a tracker issue for various xmlns related changes.

  • protect Maui XmlnsDefinition to avoid overloading it and causing conflicts
  • allow XmlnsDefinition in current assembly. This will allow consuming an XmlnsDefinition in the assembly where it is defined.
  • support XmlnsCompatibleWith (or other name) attribute to allow aggregating xmlns
  • global xmlns: add a GlobalXmlns.cs in the template as a place for users to aggregate xmlns in a new global namespace.
  • implicit xmlns: sourcegen some predefined xmlns in a default xmlns (to allow backward compatibility without updating the app template) (opt-out)
  • make the declaration of default xmlns implicit (opt-in)
  • allow using xmlns prefixes without having to declare them (opt-in)

with those changes, this is the maui XAML of 2025

<ContentPage>
    <StackLayout>
        <MyControl x:Name="control" />
        <Label />
        <sf:Button x:Name="disambiguated" />
    </StackLayout>
</ContentPage>

this set of spec replaces #3376

Please do not comment on individual specs here, but on their own pages. thanks

closes #3376

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions