Optimal ViewModel and Wizard creation patterns for Avalonia using Zafiro and ReactiveUI.
Add this skill
npx mdskills install sickn33/avalonia-viewmodels-zafiroHigh-level overview lacks actionable agent instructions and references missing guide files
1---2name: avalonia-viewmodels-zafiro3description: Optimal ViewModel and Wizard creation patterns for Avalonia using Zafiro and ReactiveUI.4---56# Avalonia ViewModels with Zafiro78This 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.910## Core Principles11121. **Functional-Reactive Approach**: Use ReactiveUI (`ReactiveObject`, `WhenAnyValue`, etc.) to handle state and logic.132. **Enhanced Commands**: Utilize `IEnhancedCommand` for better command management, including progress reporting and name/text attributes.143. **Wizard Pattern**: Implement complex flows using `SlimWizard` and `WizardBuilder` for a declarative and maintainable approach.154. **Automatic Section Discovery**: Use the `[Section]` attribute to register and discover UI sections automatically.165. **Clean Composition**: map ViewModels to Views using `DataTypeViewLocator` and manage dependencies in the `CompositionRoot`.1718## Guides1920- [ViewModels & Commands](viewmodels.md): Creating robust ViewModels and handling commands.21- [Wizards & Flows](wizards.md): Building multi-step wizards with `SlimWizard`.22- [Navigation & Sections](navigation_sections.md): Managing navigation and section-based UIs.23- [Composition & Mapping](composition.md): Best practices for View-ViewModel wiring and DI.2425## Example Reference2627For real-world implementations, refer to the **Angor** project:28- `CreateProjectFlowV2.cs`: Excellent example of complex Wizard building.29- `HomeViewModel.cs`: Simple section ViewModel using functional-reactive commands.30
Full transparency — inspect the skill content before installing.