-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Description
Building on #28849, and even if the user choose to pack most of the xmlns into the global one #28846, we might need prefixes to disambiguate name conflicts.
Say we have this xaml
<ContentPage>
<Label x:Name="mauilabel"/>
<Label x:Name="mylabel"/>
</ContentPage>stay with me. say that the default xmlns is the global one (#28849), and aggregates (#28843 , #28846, #28847) maui and your own controls, AND that a "Label" type is defined twice.
the parser will complain, and ask for disambiguation.
in this case, we consume 3 xmlns prefixes, without defining them. they are automatically fed (like the default one) into the parser (not making this an invalid xml), with the prefixes found as defined by XmlnsPrefix attribute
<ContentPage>
<maui:Label x:Name="mauilabel"/>
<local:Label x:Name="mylabel"/>
</ContentPage>This is NOT invalid XML. It's an invalid xml DOCUMENT, but it's a valid xml FRAGMENT. All the tools used for parsing xml will keep working, provided the default xmlns is fed into the parser.
This is an OPT-IN feature, and you can choose to use it or not. if you declare your own prefix, it will be used instead of the predefined one
(Public) API Changes
/
Usage Scenarios
/
Backward Compatibility
/
Difficulty
Low