Skip to main content
net10.0net8.0net9.0

The set of base classes and extension methods over Avalonia's controls to define views/markup with C# code instead of XAML.

Published
Apr 16, 2026
6mo ago
Total Downloads
49.6K
49,565

Install

dotnet add package Avalonia.Markup.Declarative --version 12.0.1-preview7
ProductVersions
.NET
net10.0net8.0net9.0

README


Avalonia.Markup.Declarative

Write Avalonia UI with pure C#

repo: https://github.com/AvaloniaUI/Avalonia.Markup.Declarative

to use with external libraries, install AvaloniaExtensionGenerator tool here:

https://www.nuget.org/packages/AvaloniaExtensionGenerator/

Quick Start sample:

https://github.com/AvaloniaUI/Avalonia.Markup.Declarative/tree/master/src/Samples/DeclarativeComponentTemplate

Compiled-binding setters support automatic conversion for common primitive and nullable mismatches. Prefer x => x.Property without casts; for example, int -> double and bool -> bool? bindings work without a manual converter, and lossy numeric TwoWay convert-back truncates toward zero.

Changes from Previous Version

No structural changes between v12.0.1-preview6 and v12.0.1-preview7.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.