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

Full type name consistency for created UserControls #255

Open
stevemonaco opened this issue Apr 15, 2024 · 2 comments
Open

Full type name consistency for created UserControls #255

stevemonaco opened this issue Apr 15, 2024 · 2 comments
Labels

Comments

@stevemonaco
Copy link

Describe the bug

Avalonia templates are currently split between avalonia-dotnet-templates and AvaloniaVS. However, each has their own type convention when creating a UserControl (possibly others) within a folder. avalonia-dotnet-templates will omit any folder names while AvaloniaVS preserves them. eg.

AvaloniaApplication.TestView - avalonia-dotnet-templates
AvaloniaApplication.Views.TestView - AvaloniaVS

This has led to several issues / PRs being opened in avalonia-docs from beginners.

To Reproduce

  • Use VS. Have both AvaloniaVS and avalonia-dotnet-templates installed.
  • Create "User Control (Avalonia)" in a folder
  • Create "Avalonia UserControl (AvaloniaUI)" in a folder
  • Compare full type names

image

Avalonia Templates version

11.0.10.1

Avalonia version

No response

Additional context

I'm not necessarily advocating for one way or the other, only consistency whether the update is made here or in AvaloniaVS.

I use feature folders, so I always need to fix up these things anyways. My preference would be always: AvaloniaApplication.Views.TestView regardless of what folder the UserControl is created in, but I don't think this is a popular convention. VS matches namespaces to folder structure by default for other files (C#), so that's probably the user expectation.

@Mrxx99
Copy link
Contributor

Mrxx99 commented Apr 16, 2024

See #235

@stevemonaco
Copy link
Author

Thanks. Will avalonia-dotnet-templates adopt adding the folder convention to the namespace if/when it's available? I will need to add a caution section to the Avalonia docs (possibly a few places) in the meantime.

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

No branches or pull requests

2 participants