XAML becomes inspectable C#
SourceGen XAML Compiler
Bring XAML compilation into the source-generator model and make its output visible to normal tooling.
Explore source ↗Capability
A Roslyn incremental pipeline parses, binds, validates, and emits Avalonia XAML as generated C#, with framework-neutral compiler layers and an Avalonia semantic adapter.
- 01
Incremental Roslyn generation
- 02
Framework-neutral semantic core
- 03
Avalonia binder and emitter
- 04
Runtime URI loading and migration weaving
How it composes
From intent
to working system.
Parse
Immutable models preserve XAML structure and source locations.
Bind
Framework semantics resolve types, members, markup, resources, and bindings.
Emit
Generated C# constructs and initializes the object graph.
Load
Build and runtime registries connect generated factories to application URIs.
Quick start
Adopt this
capability.
Start with the primary module, then add the related packages only when the application needs those layers. Replace VERSION with the current NuGet version.
dotnet add package XamlToCSharpGenerator<PackageReference Include="XamlToCSharpGenerator" Version="VERSION" /><PackageVersion Include="XamlToCSharpGenerator" Version="VERSION" /><PropertyGroup> <AvaloniaXamlCompilerBackend>SourceGen</AvaloniaXamlCompilerBackend></PropertyGroup>
<ItemGroup> <PackageReference Include="XamlToCSharpGenerator" Version="VERSION" /></ItemGroup>Modules in this capability
Use one layer.
Compose the rest.
Source of truth
Read the module beside the complete system.
The implementation, samples, issues, and release notes stay in the parent repository so module details remain connected to the product architecture.