Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AssemblyName support into XmlnsDefinition attribute #17498

Open
wieslawsoltes opened this issue Nov 13, 2024 · 3 comments
Open

Add AssemblyName support into XmlnsDefinition attribute #17498

wieslawsoltes opened this issue Nov 13, 2024 · 3 comments

Comments

@wieslawsoltes
Copy link
Collaborator

wieslawsoltes commented Nov 13, 2024

Is your feature request related to a problem? Please describe.

I want to include types into https://github.com/avaloniaui namespace and to do that I want to use XmlnsDefinition but it does not support AssemblyName (you can add AssemblyName when using xmlns inside xaml file e.g. xmlns:sys="clr-namespace:System;assembly=mscorlib")

Describe the solution you'd like

Instead defining each time xmlns in xaml files like xmlns:sys="clr-namespace:System;assembly=mscorlib" I want to include them in Avalonia namespace via XmlnsDefinition

[assembly: XmlnsDefinition("https://github.com/avaloniaui ", "System", AssemblyName = "mscorlib")]

Describe alternatives you've considered

No response

Additional context

Instead:

xmlns:sys="clr-namespace:System;assembly=mscorlib"
<sys:Tuple x:TypeArguments="sys:Int32, sys:String"
           xmlns:sys="clr-namespace:System;assembly=mscorlib"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <x:Arguments>
        <sys:Int32>42</sys:Int32>
        <sys:String>Hello World</sys:String>
    </x:Arguments>
</sys:Tuple>

we could have clean xaml syntax:

    <Tuple x:Key="Tuple" x:TypeArguments="Int32, String">
      <x:Arguments>
        <Int32>42</Int32>
        <String>Hello World</String>
      </x:Arguments>
    </Tuple>
@maxkatz6
Copy link
Member

In Avalonia you can write xmlns:sys="using:System" without specifying any assembly, which I use often for this namespace.
Doesn't the same work for [assembly: XmlnsDefinition("https://github.com/avaloniaui ", "System")] ?

@wieslawsoltes
Copy link
Collaborator Author

In Avalonia you can write xmlns:sys="using:System" without specifying any assembly, which I use often for this namespace. Doesn't the same work for [assembly: XmlnsDefinition("https://github.com/avaloniaui ", "System")] ?

[assembly: XmlnsDefinition("https://github.com/avaloniaui ", "System")] does not work

@wieslawsoltes
Copy link
Collaborator Author

Here is my test project https://github.com/wieslawsoltes/TupleDemo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants