KEMBAR78
Stop supporting Namescope, FindByName and IReferenceProvider unless a flag is set · Issue #30434 · dotnet/maui · GitHub
Skip to content

Stop supporting Namescope, FindByName and IReferenceProvider unless a flag is set #30434

@StephaneDelcroix

Description

@StephaneDelcroix

Description

Supporting public Namescope, FindByName and IReferenceProvider (for markup extension) requires maintaining a lot of state for a feature that is seldom used.

We can't deprecate it as it will still be used by the runtime xaml inflator, but we might throw NotSupportedException unless some flag is set.

If the flag isn't set, sourcegen Xaml inflator won't create the namescopes and won't register the names.

For the time being, until xaml sourcegen becomes the default, the flag will be set by default

Public API Changes

All of those

public Element.FindByName(string name);

public interface INameScope{} //already EditorBrowseableState.Never

public class NameScope{} //already EditorBrowseableState.Never

public static class NameScopeExtensions {}

public interface IReferenceProvider {}

will throw NotSupportedException()

Intended Use-Case

/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions