Ultimate Avalonia Framework
Battle-tested skill for optimal, viewmodel, wizard, creation. Includes structured workflows, validation checks, and reusable patterns for development.
Ultimate Avalonia Framework
A comprehensive Claude Code skill for building cross-platform desktop applications with Avalonia UI and .NET. Covers project setup, MVVM architecture, control customization, platform integration, packaging, and deployment across Windows, macOS, and Linux.
When to Use This Skill
Choose Ultimate Avalonia Framework when:
- You're building a new cross-platform desktop application with .NET
- You need to set up an Avalonia project with proper architecture
- You want to implement custom controls, themes, or styling
- You need platform-specific integration (file system, notifications, tray icons)
- You're packaging and distributing an Avalonia app
Consider alternatives when:
- You want Zafiro-specific layouts (use an Avalonia Layout Zafiro skill)
- You need web-based UI (use a web frontend skill)
- You want mobile-only apps (use a mobile development skill)
Quick Start
# Create a new Avalonia project dotnet new avalonia.app -o MyApp --framework net8.0 # Install the skill claude install ultimate-avalonia-framework # Set up the project claude "Set up an Avalonia MVVM project with ReactiveUI, dependency injection, and a multi-window layout" # Add custom controls claude "Create a custom DataGrid control with sorting, filtering, and row selection for my Avalonia app"
Core Concepts
Avalonia vs Other Desktop Frameworks
| Feature | Avalonia | WPF | MAUI | Electron |
|---|---|---|---|---|
| Platforms | Win, Mac, Linux, Web | Windows only | Win, Mac, iOS, Android | Win, Mac, Linux |
| Language | C#, XAML | C#, XAML | C#, XAML | JS/TS, HTML |
| Performance | Native rendering | Native (Win) | Native per platform | Chromium-based |
| Bundle Size | ~30MB | ~5MB (framework included) | ~50MB | ~100MB+ |
| Ecosystem | Growing | Mature | Growing | Massive |
MVVM Architecture
Views (XAML) ā Visual layout, no logic
ā Data Binding
ViewModels (C#) ā Presentation logic, commands
ā Services
Models (C#) ā Business logic, data access
Project Structure:
āāā Views/
ā āāā MainWindow.axaml
ā āāā DashboardView.axaml
ā āāā SettingsView.axaml
āāā ViewModels/
ā āāā MainWindowViewModel.cs
ā āāā DashboardViewModel.cs
ā āāā SettingsViewModel.cs
āāā Models/
ā āāā AppSettings.cs
āāā Services/
ā āāā DataService.cs
āāā App.axaml (theme + DI setup)
Control Hierarchy
| Control Type | Examples | Customization |
|---|---|---|
| Layout | StackPanel, Grid, DockPanel, WrapPanel | Properties only |
| Input | TextBox, ComboBox, Slider, DatePicker | Styles + templates |
| Display | TextBlock, Image, Border, ProgressBar | Styles |
| Collection | ListBox, DataGrid, TreeView, ItemsRepeater | DataTemplates |
| Navigation | TabControl, Carousel, SplitView | Templates |
| Feedback | ProgressBar, Notification, Dialog | Custom implementations |
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
target_framework | string | "net8.0" | .NET version: net8.0, net9.0 |
mvvm_framework | string | "reactive_ui" | MVVM: reactive_ui, community_toolkit |
di_container | string | "microsoft" | DI: microsoft, autofac, dry_ioc |
platforms | string[] | ["win", "mac", "linux"] | Target platforms |
theme | string | "fluent" | Theme: fluent, simple, custom |
Best Practices
-
Use ReactiveUI for MVVM ā ReactiveUI's reactive extensions integrate naturally with Avalonia's binding system. WhenAnyValue, reactive commands, and observable interactions make complex UI logic clean and testable.
-
Design for all three platforms from the start ā Test on Windows, macOS, and Linux regularly. Platform differences in font rendering, file paths, and system integration surface early in development.
-
Use DataTemplates for dynamic content ā Instead of creating views imperatively, define DataTemplates that automatically render the appropriate view for each view model type. This keeps your navigation clean and type-safe.
-
Optimize startup time ā Desktop apps should launch in under 2 seconds. Use ahead-of-time (AOT) compilation, lazy-load non-essential services, and defer heavy initialization until after the main window is visible.
-
Package properly for each platform ā Windows users expect .msi or .msix installers. macOS users expect .dmg or .app bundles. Linux users expect .deb, .rpm, or AppImage. Use platform-appropriate packaging tools.
Common Issues
Different rendering on different platforms ā Avalonia renders with Skia, so it should be consistent, but font availability and system DPI settings vary. Include your fonts as embedded resources and handle DPI scaling properly.
XAML designer doesn't show preview ā Install the Avalonia extension for your IDE. JetBrains Rider has the best Avalonia designer support. Visual Studio support requires the Avalonia VS extension.
App crashes on macOS with M1/M2 ā Ensure you're building for ARM64 architecture. Use dotnet publish -r osx-arm64 for Apple Silicon. Universal binaries that include both x64 and ARM64 are recommended for distribution.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Full-Stack Code Reviewer
Comprehensive code review skill that checks for security vulnerabilities, performance issues, accessibility, and best practices across frontend and backend code.
Test Suite Generator
Generates comprehensive test suites with unit tests, integration tests, and edge cases. Supports Jest, Vitest, Pytest, and Go testing.
Pro Architecture Workspace
Battle-tested skill for architectural, decision, making, framework. Includes structured workflows, validation checks, and reusable patterns for development.