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
Parent systemXamlToCSharpGenerator
StatusActive
Modules3
RepositoryXamlToCSharpGenerator/XamlToCSharpGenerator.Compiler

A Roslyn incremental pipeline parses, binds, validates, and emits Avalonia XAML as generated C#, with framework-neutral compiler layers and an Avalonia semantic adapter.

  1. 01

    Incremental Roslyn generation

  2. 02

    Framework-neutral semantic core

  3. 03

    Avalonia binder and emitter

  4. 04

    Runtime URI loading and migration weaving

From intent
to working system.

01

Parse

Immutable models preserve XAML structure and source locations.

02

Bind

Framework semantics resolve types, members, markup, resources, and bindings.

03

Emit

Generated C# constructs and initializes the object graph.

04

Load

Build and runtime registries connect generated factories to application URIs.

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.

01 · Install
Terminal
dotnet add package XamlToCSharpGenerator
02 · Use · xml
MainWindow.axaml
<PropertyGroup>
<AvaloniaXamlCompilerBackend>SourceGen</AvaloniaXamlCompilerBackend>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="XamlToCSharpGenerator" Version="VERSION" />
</ItemGroup>

Use one layer.
Compose the rest.

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.

XamlToCSharpGenerator

Search everything.

Loading the index…

move open esc close

Preparing metadata and full-text search…