veloxdev-write-viewmodels

Write C# ViewModels using VeloxDev source generators for observable properties, commands, and frame loops.

37|12|Updated Jun 5, 2025
One-click install
npx skills add https://github.com/Axvser/VeloxDev --skill veloxdev-write-viewmodels-axvser
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: veloxdev-write-viewmodels
Source: https://github.com/Axvser/VeloxDev/tree/main/skills/veloxdev-write-viewmodels
Command: npx skills add https://github.com/Axvser/VeloxDev --skill veloxdev-write-viewmodels-axvser

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing ViewModels by hand means repetitive INotifyPropertyChanged plumbing, RelayCommand boilerplate, and collection-change wiring. This Skill guides the use of VeloxDev's compile-time source generators so a partial class with attributes produces all of that automatically — and it documents the silent failure modes (missing partial, no diagnostics emitted) that otherwise leave developers guessing why nothing was generated. ## Core Features & Use Cases - Observable properties with [VeloxProperty]: Generate notifying properties from fields or partial properties, with (oldValue, newValue) change callbacks, naming rules, and automatic collection-change hooks for INotifyCollectionChanged types. - Commands with [VeloxCommand]: Generate lazily-cached IVeloxCommand members from Task/void methods, with cancellation tokens, semaphore-based concurrency, CanExecute validation, and a full lifecycle event set. - MVVM framework interop: The generator detects CommunityToolkit.Mvvm, Prism, ReactiveUI, and Caliburn.Micro and routes the setter through the host framework's notification mechanism. - [MonoBehaviour] frame loop: Give any POCO a Unity-style Awake/Update/FixedUpdate lifecycle on a background channel via MonoBehaviourManager. - Use Case: You are building a WPF or Avalonia workflow editor and need a node ViewModel with observable slots, an async save command with cancellation, and collection hooks — write a partial class with three attributes instead of hundreds of lines of plumbing. ## Quick Start Ask the AI to write a partial C# ViewModel class using VeloxDev's [VeloxProperty] for an observable property and [VeloxCommand] for an async command with cancellation.

Frequently Asked Questions about veloxdev-write-viewmodels

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create observable properties in C# without writing INotifyPropertyChanged code?

Apply [VeloxProperty] to a field or partial property in a partial class and the VeloxDev generator emits the notifying property, PropertyChanging/PropertyChanged events, and OnXChanging/OnXChanged partial callbacks taking old and new values.

How do I generate an async RelayCommand with cancellation in .NET?

Decorate a Task-returning method that accepts a CancellationToken with [VeloxCommand]. The generator produces a lazily-cached IVeloxCommand supporting ExecuteAsync, semaphore-based concurrency, locking, interruption, and lifecycle events.

Why is my [VeloxProperty] attribute not generating any property?

The class must be declared partial; the generator matches on that modifier and emits no diagnostics when it is missing. Other silent causes include a non-partial property form, a name collision with an existing member, or a competing attribute like [ObservableProperty].

Does VeloxDev work with CommunityToolkit.Mvvm, Prism, or ReactiveUI?

Yes. The generator detects the host framework and routes the setter through its notification mechanism — SetProperty for CommunityToolkit and Prism, IReactiveObject for ReactiveUI, and NotifyOfPropertyChange for Caliburn.Micro. Members already carrying competing attributes are skipped.

How do I add a Unity-style Update loop to a plain C# class?

Apply [MonoBehaviour] to a partial class, call InitializeMonoBehaviour() from the constructor, implement partial void Update(FrameEventArgs e), and start the channel with MonoBehaviourManager.Start. The behaviour ticks on a background thread at the channel's configured FPS.