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

Proposal: Provide a way to use different namespaces for generated Rx* classes #215

Open
kmgallahan opened this issue Feb 23, 2024 · 0 comments

Comments

@kmgallahan
Copy link

kmgallahan commented Feb 23, 2024

Problem

I'm building WinUI 3 projects using Visual Studio Version 17.10.0 Preview 1.0.

Currently, given these circumstances:

  • A WinUI 3 app exists with namespace A.B.C
  • A WinUI 3 app library exists with namespace X.Y.Z
  • The app project has a project reference to the library project
  • A X.Y.Z namespace declaration is made anywhere in the app project

Then all XAML references to anything found in the library will have the following error appear in Visual Studio while the files containing them are open:

XLS0414	The type 'someX.Y.Zcontrol' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

This means that any time an Rx* class is generated with an X.Y.Z namespace in the app project a large number of errors show up in Visual Studio.

The app project will still build and run fine, the errors are just distracting and clog up the Error List window.

Proposal

Provide a mechanism to use different namespaces for generated Rx* classes than the those for which the type was declared in.

Either

  • Attribute decoring any class in a project instructs the generator to use that project's namespace for all generated classes (not great as it could cause conflicts).
  • Append something to the namespace declarations, such as X.Y.Z.RxEvents. This could optionally be turned on per project by adding an Attribute to any class in a project. The errors only appear for exact namespace declaration matches.

I don't know if the appearance of the errors is intentional. I imagine getting the issue resolved on the Microsoft side would take a monumental effort, compared to tweaking this generator slightly.

@kmgallahan kmgallahan changed the title Proposal: Provide a way to use different namespaces for generated RxLink* classes Proposal: Provide a way to use different namespaces for generated Rx* classes Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant