Skill

Generate Avalonia ViewModels with ReactiveUI and Zafiro

Skill for Avalonia ViewModels, wizards, and navigation using ReactiveUI and the Zafiro toolkit's SlimWizard and CompositionRoot.

Works with github

77
Spark score
out of 100
Updated 18 days ago
Version 14.2.0

Add to Favorites

Why it matters

Streamline the development of Avalonia applications by providing a robust framework for creating ViewModels, managing complex wizard flows, and implementing functional-reactive patterns with ReactiveUI and the Zafiro toolkit.

Outcomes

What it gets done

01

Implement functional-reactive ViewModels using ReactiveUI.

02

Build multi-step wizards with SlimWizard and WizardBuilder.

03

Manage application navigation and UI section discovery.

04

Apply best practices for ViewModel composition and dependency injection.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/ag-avalonia-viewmodels-zafiro | bash

Overview

Avalonia ViewModels with Zafiro

A skill for building Avalonia ViewModels, wizards, and navigation using ReactiveUI and the Zafiro toolkit's SlimWizard, Section discovery, and composition patterns. Use when building an Avalonia app's ViewModels, multi-step wizards, or navigation with ReactiveUI and Zafiro conventions.

What it does

Avalonia ViewModels with Zafiro is a skill covering best practices for building ViewModels, wizards, and navigation in Avalonia applications using ReactiveUI and the Zafiro toolkit. It's built around five principles: a functional-reactive approach using ReactiveUI's ReactiveObject and WhenAnyValue for state and logic; IEnhancedCommand for command management with progress reporting and name/text attributes; the SlimWizard/WizardBuilder pattern for declarative multi-step flows; the [Section] attribute for automatic UI section discovery and registration; and clean View-ViewModel composition via DataTypeViewLocator and a CompositionRoot for dependency management.

When to use - and when NOT to

Use it when building an Avalonia application's presentation layer with ReactiveUI and Zafiro - ViewModels, multi-step wizards, section-based navigation, and View-ViewModel wiring - reaching for the topic-specific guide as needed: viewmodels.md for ViewModels and commands, wizards.md for multi-step flows. It is not a general Avalonia or ReactiveUI reference; it's scoped specifically to the Zafiro toolkit's patterns on top of them.

Inputs and outputs

The skill is organized into four linked guides: ViewModels & Commands (building robust ViewModels and handling commands), Wizards & Flows (building multi-step wizards with SlimWizard), Navigation & Sections (managing navigation and section-based UIs), and Composition & Mapping (View-ViewModel wiring and dependency injection best practices). For real-world reference it points to the Angor project's CreateProjectFlowV2.cs (a complex wizard-building example) and HomeViewModel.cs (a simple section ViewModel using functional-reactive commands).

Integrations

Built directly on ReactiveUI for reactive state and command handling, and the Zafiro toolkit for the wizard, section-discovery, and composition patterns layered on top - documented respectively in navigation_sections.md for section-based UI management and composition.md for the dependency-injection conventions tying views to view models.

Who it's for

.NET developers building Avalonia desktop applications with ReactiveUI who want established Zafiro patterns - proven in the real Angor codebase rather than a toy sample - for wizards, navigation, and ViewModel composition instead of assembling them from scratch.

FAQ

Common questions

Discussion

Questions & comments ยท 0

Sign In Sign in to leave a comment.