avalonia-zafiro-development

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Avalonia Zafiro Development

Avalonia Zafiro 开发

This skill defines the mandatory conventions and behavioral rules for developing cross-platform applications with Avalonia UI and the Zafiro toolkit. These rules prioritize maintainability, correctness, and a functional-reactive approach.
本技能定义了使用Avalonia UI和Zafiro工具包开发跨平台应用的强制规范和行为准则。这些规则将可维护性、正确性和函数式响应式方法列为优先事项。

Core Pillars

核心支柱

  1. Functional-Reactive MVVM: Pure MVVM logic using DynamicData and ReactiveUI.
  2. Safety & Predictability: Explicit error handling with
    Result
    types and avoidance of exceptions for flow control.
  3. Cross-Platform Excellence: Strictly Avalonia-independent ViewModels and composition-over-inheritance.
  4. Zafiro First: Leverage existing Zafiro abstractions and helpers to avoid redundancy.
  1. 函数式响应式MVVM:使用DynamicData和ReactiveUI实现纯MVVM逻辑。
  2. 安全性与可预测性:使用
    Result
    类型进行显式错误处理,避免将异常用于流程控制。
  3. 跨平台卓越性:严格与Avalonia无关的ViewModel,以及组合优于继承的原则。
  4. 优先使用Zafiro:利用现有Zafiro抽象和辅助工具,避免冗余代码。

Guides

指南

  • Core Technical Skills & Architecture: Fundamental skills and architectural principles.
  • Naming & Coding Standards: Rules for naming, fields, and error handling.
  • Avalonia, Zafiro & Reactive Rules: Specific guidelines for UI, Zafiro integration, and DynamicData pipelines.
  • Zafiro Shortcuts: Concise mappings for common Rx/Zafiro operations.
  • Common Patterns: Advanced patterns like
    RefreshableCollection
    and Validation.
  • 核心技术技能与架构:基础技能和架构原则。
  • 命名与编码标准:命名、字段和错误处理的规则。
  • Avalonia、Zafiro与响应式规则:UI、Zafiro集成和DynamicData管道的特定指南。
  • Zafiro快捷操作:常见Rx/Zafiro操作的简明映射。
  • 常见模式:高级模式如
    RefreshableCollection
    和验证。

Procedure Before Writing Code

编写代码前的步骤

  1. Search First: Search the codebase for similar implementations or existing Zafiro helpers.
  2. Reusable Extensions: If a helper is missing, propose a new reusable extension method instead of inlining complex logic.
  3. Reactive Pipelines: Ensure DynamicData operators are used instead of plain Rx where applicable.
  1. 先搜索:在代码库中搜索类似实现或现有Zafiro辅助工具。
  2. 可复用扩展:如果缺少辅助工具,建议编写新的可复用扩展方法,而非内联复杂逻辑。
  3. 响应式管道:在适用情况下,确保使用DynamicData操作符而非普通Rx操作。