Skip to main content
Any Framework

dotnet new templates for Avalonia apps using the Zafiro toolkit (Shell, sections via [Section] attribute, AddZafiroShell, MVVM with ReactiveUI).

Published
Jun 17, 2026
4mo ago
Total Downloads
4.3K
4,335

Install

dotnet add package Zafiro.Avalonia.Templates --version 53.3.0

No framework information available.

README

Zafiro.Avalonia.Templates

dotnet new templates for building Avalonia apps with the Zafiro toolkit.

Install

dotnet new install Zafiro.Avalonia.Templates

Templates

Short name Description
zafiro-shell Cross-platform Avalonia app (Desktop, Browser, Android, iOS) with the Zafiro Shell, section auto-discovery via [Section], MVVM via ReactiveUI.

Usage

dotnet new zafiro-shell -n MyApp
cd MyApp
dotnet run --project MyApp.Desktop

Options

Option Description Default
-n, --name Application/solution name (also used as namespace). ZafiroShellTemplate
--application-id Android ApplicationId and iOS CFBundleIdentifier. com.example.<name-lowercase>

What you get

  • Multi-project solution (.slnx):
    • Shared head (MyApp/) — App.axaml, App.axaml.cs bootstrap with AddZafiroShell + AddAllSectionsFromAttributes, plus Sections/ (Home / Settings / About) — each section is a ViewModel + View pair tagged with [Section] so it is auto-discovered and added to the shell.
    • MyApp.Desktop — Windows / Linux / macOS via Avalonia.Desktop.
    • MyApp.Browser — WebAssembly via Avalonia.Browser.
    • MyApp.Android — Avalonia.Android.
    • MyApp.iOS — Avalonia.iOS.
  • Central Package Management (Directory.Packages.props) with pinned Avalonia 12 + Zafiro versions.
  • Compiled bindings on by default.
  • ReactiveUI.Avalonia as the MVVM integration.
  • Zafiro.Avalonia.Mcp.AppHost wired into Desktop in Debug builds (via .UseMcpDiagnostics() under #if DEBUG) so AI agents and other MCP clients can inspect/drive the running UI.

Adding a new section

Create a ViewModel + View pair anywhere under the shared head and decorate the ViewModel with [Section]:

[Section("Profile", "fa-solid fa-user", sortIndex: 3)]
public partial class ProfileViewModel : ReactiveObject { /* ... */ }

The Zafiro source generator will register it automatically — no DI plumbing required.

Uninstall

dotnet new uninstall Zafiro.Avalonia.Templates

Changes from Previous Version

No structural changes between v53.2.0 and v53.3.0.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

No target framework metadata is available. Confirm compatibility in a representative project before standardising on this package.

Related Guides & Workflows

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