Claude-code-templates avalonia-viewmodels-zafiro
Optimal ViewModel and Wizard creation patterns for Avalonia using Zafiro and ReactiveUI.
install
source · Clone the upstream repo
git clone https://github.com/davila7/claude-code-templates
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/davila7/claude-code-templates "$T" && mkdir -p ~/.claude/skills && cp -r "$T/cli-tool/components/skills/development/avalonia-viewmodels-zafiro" ~/.claude/skills/davila7-claude-code-templates-avalonia-viewmodels-zafiro && rm -rf "$T"
manifest:
cli-tool/components/skills/development/avalonia-viewmodels-zafiro/SKILL.mdsource content
Avalonia ViewModels with Zafiro
This skill provides a set of best practices and patterns for creating ViewModels, Wizards, and managing navigation in Avalonia applications, leveraging the power of ReactiveUI and the Zafiro toolkit.
Core Principles
- Functional-Reactive Approach: Use ReactiveUI (
,ReactiveObject
, etc.) to handle state and logic.WhenAnyValue - Enhanced Commands: Utilize
for better command management, including progress reporting and name/text attributes.IEnhancedCommand - Wizard Pattern: Implement complex flows using
andSlimWizard
for a declarative and maintainable approach.WizardBuilder - Automatic Section Discovery: Use the
attribute to register and discover UI sections automatically.[Section] - Clean Composition: map ViewModels to Views using
and manage dependencies in theDataTypeViewLocator
.CompositionRoot
Guides
- ViewModels & Commands: Creating robust ViewModels and handling commands.
- Wizards & Flows: Building multi-step wizards with
.SlimWizard - Navigation & Sections: Managing navigation and section-based UIs.
- Composition & Mapping: Best practices for View-ViewModel wiring and DI.
Example Reference
For real-world implementations, refer to the Angor project:
: Excellent example of complex Wizard building.CreateProjectFlowV2.cs
: Simple section ViewModel using functional-reactive commands.HomeViewModel.cs