mcpField
A
avalonia-viewmodels-zafiro

avalonia-viewmodels-zafiro

github.com/davila7Development33.1k184 installsUpdated today
Repository

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

  1. 01ReactiveUI 状态与逻辑模式
  2. 02带进度报告的增强命令
  3. 03SlimWizard 与 WizardBuilder 流程
  4. 04通过 Section 自动发现 UI 区块
  5. 05DataTypeViewLocator 与依赖组合

Use cases

  1. 01构建响应式 Avalonia ViewModel
  2. 02实现多步骤向导流程
  3. 03自动注册并发现 UI 区块
  4. 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-zafiro

After installing, type/avalonia-viewmodels-zafiroin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

composition.md
navigation_sections.md
viewmodels.md
wizards.md

Details

From the project README

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

  1. Functional-Reactive Approach: Use ReactiveUI (ReactiveObject, WhenAnyValue, etc.) to handle state and logic.
  2. Enhanced Commands: Utilize IEnhancedCommand for better command management, including progress reporting and name/text attributes.
  3. Wizard Pattern: Implement complex flows using SlimWizard and WizardBuilder for a declarative and maintainable approach.
  4. Automatic Section Discovery: Use the [Section] attribute to register and discover UI sections automatically.
  5. Clean Composition: map ViewModels to Views using DataTypeViewLocator and manage dependencies in the CompositionRoot.

Guides

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