[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-16d6afaf-c6e8-4f8d-9fbf-9a5f05d3522a":3,"$fz9kqA2Jo8hvNlOOxEvriFsIpWSMgsg3SPmO4WrFqqZE":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"16d6afaf-c6e8-4f8d-9fbf-9a5f05d3522a","avalonia-viewmodels-zafiro","Avalonia使用Zafiro和ReactiveUI的最佳ViewModel和向导创建模式。","cat_coding_frontend","mod_coding","sickn33,coding","---\nname: avalonia-viewmodels-zafiro\ndescription: \"Optimal ViewModel and Wizard creation patterns for Avalonia using Zafiro and ReactiveUI.\"\nrisk: none\nsource: community\ndate_added: \"2026-02-27\"\n---\n\n# Avalonia ViewModels with Zafiro\n\nThis 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.\n\n## Core Principles\n\n1.  **Functional-Reactive Approach**: Use ReactiveUI (`ReactiveObject`, `WhenAnyValue`, etc.) to handle state and logic.\n2.  **Enhanced Commands**: Utilize `IEnhancedCommand` for better command management, including progress reporting and name\u002Ftext attributes.\n3.  **Wizard Pattern**: Implement complex flows using `SlimWizard` and `WizardBuilder` for a declarative and maintainable approach.\n4.  **Automatic Section Discovery**: Use the `[Section]` attribute to register and discover UI sections automatically.\n5.  **Clean Composition**: map ViewModels to Views using `DataTypeViewLocator` and manage dependencies in the `CompositionRoot`.\n\n## Guides\n\n- [ViewModels & Commands](viewmodels.md): Creating robust ViewModels and handling commands.\n- [Wizards & Flows](wizards.md): Building multi-step wizards with `SlimWizard`.\n- [Navigation & Sections](navigation_sections.md): Managing navigation and section-based UIs.\n- [Composition & Mapping](composition.md): Best practices for View-ViewModel wiring and DI.\n\n## Example Reference\n\nFor real-world implementations, refer to the **Angor** project:\n- `CreateProjectFlowV2.cs`: Excellent example of complex Wizard building.\n- `HomeViewModel.cs`: Simple section ViewModel using functional-reactive commands.\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,246,369,"2026-05-16 13:04:44",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"前端开发","frontend","mdi-language-html5","HTML\u002FCSS\u002FJavaScript\u002F框架相关",1,96,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"2ee36a9d-46ea-4f23-b9b0-c8653c79a823","1.0.0","avalonia-viewmodels-zafiro.zip",4738,"uploads\u002Fskills\u002F16d6afaf-c6e8-4f8d-9fbf-9a5f05d3522a\u002Favalonia-viewmodels-zafiro.zip","055b1691413dbb964b625d67aaf8fcc146b53d064a2dd3538dab5f07dfc448fe","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":2141},{\"path\":\"composition.md\",\"isDirectory\":false,\"size\":2227},{\"path\":\"navigation_sections.md\",\"isDirectory\":false,\"size\":1299},{\"path\":\"viewmodels.md\",\"isDirectory\":false,\"size\":1765},{\"path\":\"wizards.md\",\"isDirectory\":false,\"size\":1563}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]