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

Only show Avalonia project items in Avalonia projects. #265

Open
stevemonaco opened this issue Aug 21, 2024 · 0 comments
Open

Only show Avalonia project items in Avalonia projects. #265

stevemonaco opened this issue Aug 21, 2024 · 0 comments

Comments

@stevemonaco
Copy link

stevemonaco commented Aug 21, 2024

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

When using "Add New Item..." in Visual Studio, Avalonia-related items (eg. Avalonia UserControl) are always shown in the dialog for all C# projects, even if the user is trying to add something to a Console app. Other project templates, such as WPF and WinForms, do not do this.

Rider somehow already does this. It also shows Avalonia-related items in the Add context menu (VS doesn't, only shows in the dialog).

Describe the solution you'd like

The Avalonia NuGet package adds a Project Capability called "Avalonia". If we add a constraint to the templates according to https://github.com/dotnet/templating/wiki/Constraints#project-capabilities then maybe VS will respect it. Untested at the moment. VS seems to respect the "tags" for "language" in template.json at least.

Describe alternatives you've considered

No response

Additional context

I can try to test + PR this but might take quite some time as I haven't built this repo or worked with .NET templating before.

From a community complaint.

@stevemonaco stevemonaco changed the title Only show Avalonia types in Avalonia projects. Only show Avalonia project items in Avalonia projects. Aug 21, 2024
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

1 participant