Replies: 3 comments 1 reply
-
If you are using Roslyn's (relatively) new source generator mechanism, then I think it's currently not possible. Avalonia also uses source generators internally for XAML compilation, and generators cannot see each others' sources, and it's by design. See: From the link: |
Beta Was this translation helpful? Give feedback.
-
XAML compilation happens after C# compilation. But avalonia property generator happens in order with other source generators, so it might produce undefined behavior not controlled by avalonia. |
Beta Was this translation helpful? Give feedback.
-
The workaround I use is to put the entire generated class in a library then add a reference to it in the project where xaml is located. |
Beta Was this translation helpful? Give feedback.
-
Hello devs,
I have a class generated by source generator and I need to reference it in xaml. It works perfectly fine before building, but it failed building with error "class doesn't exist". Seems like XAML compilation happens before SG, is there any work around for this?
Beta Was this translation helpful? Give feedback.
All reactions