Semantic expressions inside markup
Typed Bindings & Inline C#
Let markup express typed application logic without falling back to opaque runtime reflection.
Explore source ↗Capability
Compiled binding, x:Bind, C# expressions, interpolation, inline code blocks, event lambdas, bind-back, and dependency analysis share Roslyn-backed semantics.
- 01
Typed x:Bind with bind-back
- 02
C# expression and interpolation forms
- 03
Inline event handlers and code blocks
- 04
Roslyn dependency and type analysis
How it composes
From intent
to working system.
Extract
Markup extensions and code blocks preserve expression source.
Analyze
Roslyn resolves types, members, dependencies, conversions, and diagnostics.
Generate
Typed getters, setters, handlers, and lifecycle helpers join emitted code.
Update
Dependency paths drive efficient binding refresh and bind-back.
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.ExpressionSemantics" Version="VERSION" /><PackageVersion Include="XamlToCSharpGenerator.ExpressionSemantics" Version="VERSION" /><TextBlock Text="{x:Bind ViewModel.DisplayName}" /><Button Click="{CSharp Code=ViewModel.Save()}" Content="Save" /><TextBlock> <CSharp><![CDATA[$"{ViewModel.Count:N0} items"]]></CSharp></TextBlock>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.