davila7/claude-code-templates / cli-tool/components/skills/development/avalonia-viewmodels-zafiro
avalonia-viewmodels-zafiro
VerifiedOptimal ViewModel and Wizard creation patterns for Avalonia using Zafiro and ReactiveUI.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 1.6 KB |
| composition.md | markdown | 2.2 KB |
| navigation_sections.md | markdown | 1.3 KB |
| viewmodels.md | markdown | 1.7 KB |
| wizards.md | markdown | 1.5 KB |
wizards.md
View on GitHub# Wizards & Flows
Complex multi-step processes are handled using the `SlimWizard` pattern. This provides a declarative way to define steps, navigation logic, and final results.
## Defining a Wizard
Use `WizardBuilder` to define the steps. Each step corresponds to a ViewModel.
```csharp
SlimWizard<string> wizard = WizardBuilder
.StartWith(() => new Step1ViewModel(data))
.NextUnit()
.WhenValid()
.Then(prevResult => new Step2ViewModel(prevResult))
.NextCommand(vm => vm.CustomNextCommand)
.Then(result => new SuccessViewModel("Done!"))
.Next((_, s) => s, "Finish")
.WithCompletionFinalStep();
```
### Navigation Rules
- **NextUnit()**: Advances when a simple signal is emitted.
- **NextCommand()**: Advances when a specific command in the ViewModel execution successfully.
- **WhenValid()**: Wait until the current ViewModel's validation passes before allowing navigation.
- **Always()**: Navigation is always allowed.
## Navigation Integration
The wizard is navigated using an `INavigator`:
```csharp
public async Task CreateSomething()
{
var wizard = BuildWizard();
var result = await wizard.Navigate(navigator);
// Handle result
}
```
## Step Configuration
- **WithCompletionFinalStep()**: Marks the wizard as finished when the last step completes.
- **WithCommitFinalStep()**: Typically used for wizards that perform a final "Save" or "Deploy" action.
> [!NOTE]
> The `SlimWizard` handles the "Back" command automatically, providing a consistent user experience across different flows.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |