About avalonia-viewmodels-zafiro
A pattern guide for Avalonia ViewModels, wizards, and navigation using ReactiveUI and Zafiro. It is intended for application developers and covers command handling, section discovery, and View-ViewModel composition.
Key features
- 01ReactiveUI 状态与逻辑模式
- 02带进度报告的增强命令
- 03SlimWizard 与 WizardBuilder 流程
- 04通过 Section 自动发现 UI 区块
- 05DataTypeViewLocator 与依赖组合
Use cases
- 01构建响应式 Avalonia ViewModel
- 02实现多步骤向导流程
- 03自动注册并发现 UI 区块
- 04配置 View 与 ViewModel 映射及依赖
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ davila7/ claude-code-templates --skill avalonia-viewmodels-zafiroAfter installing, type/avalonia-viewmodels-zafiroin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
composition.mdnavigation_sections.mdviewmodels.mdwizards.mdDetails
From the project READMEAvalonia 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,WhenAnyValue, etc.) to handle state and logic. - Enhanced Commands: Utilize
IEnhancedCommandfor better command management, including progress reporting and name/text attributes. - Wizard Pattern: Implement complex flows using
SlimWizardandWizardBuilderfor a declarative and maintainable approach. - Automatic Section Discovery: Use the
[Section]attribute to register and discover UI sections automatically. - Clean Composition: map ViewModels to Views using
DataTypeViewLocatorand manage dependencies in theCompositionRoot.
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:
CreateProjectFlowV2.cs: Excellent example of complex Wizard building.HomeViewModel.cs: Simple section ViewModel using functional-reactive commands.
Comments
Markdown supported