warptoolkit-commands-mvvm

Implements ICommand-style MVVM command components for WinForms buttons and ToolStrip items.

1|1|Updated Jun 12, 2022
One-click install
npx skills add https://github.com/KlausLoeffelmann/WinFormsDevTools --skill warptoolkit-commands-mvvm-klausloeffelmann
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: warptoolkit-commands-mvvm
Source: https://github.com/KlausLoeffelmann/WinFormsDevTools/tree/main/.github/skills/WARP-Commands-Mvvm
Command: npx skills add https://github.com/KlausLoeffelmann/WinFormsDevTools --skill warptoolkit-commands-mvvm-klausloeffelmann

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires WarpToolkit.WinForms.

What problem does it solve? Wiring reusable ICommand-style logic to WinForms Buttons and ToolStrip items is repetitive and hard to expose at design time. This Skill documents the WarpToolkit.WinForms command types so you can bind commands to controls and surface them in the Designer without guesswork. ## Core Features & Use Cases - Command Components: UiCommandBase, FormCommand, and MessageBoxCommand provide Designer-droppable ICommand implementations with CanExecute and RequestCanExecute support. - Design-Time Extender: CommandTypeProvider attaches commands or command types to components via an IExtenderProvider, with type converters powering Designer drop-downs. - Use Case: You need a Save button whose enabled state tracks document dirtiness. Create a SaveCommand subclass of UiCommandBase, assign it to the button through CommandTypeProvider, call WireUpCommands, and call RaiseCanExecuteChanged when state changes. ## Quick Start Ask the AI to create a custom UiCommandBase command and wire it to a WinForms button using CommandTypeProvider.

Frequently Asked Questions about warptoolkit-commands-mvvm

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

FAQPage Schema
How do I bind an ICommand to a WinForms Button?▼

Create a UiCommandBase subclass overriding Execute and optionally CanExecute, then assign it to the button with CommandTypeProvider.SetUICommand and call WireUpCommands once after InitializeComponent. The provider connects the command to the control.

How to open a Form from a command in WinForms MVVM?▼

Use FormCommand and set its FormType property to the form's Type, such as typeof(FrmOptions). When Execute is called, the command opens that form, and you can trigger it from a button's Click handler.

Does WarpToolkit.WinForms support design-time command selection?▼

Yes, CommandTypeProvider is an IExtenderProvider that adds UICommand and UICommandType extended properties to components. UiCommandInstanceConverter, UiCommandTypeConverter, and FormsTypeConverter supply the Designer drop-down standard values.

Why is my WinForms command button not updating its enabled state?▼

Bound controls only refresh when CanExecuteChanged is raised. Call RaiseCanExecuteChanged on your command whenever the conditions affecting CanExecute change, or handle the RequestCanExecute event and set e.CanExecute.

What are the limitations of WarpToolkit command types?▼

The command types live under the Experimental namespace, so the API is evolving and signatures may change between versions. UiCommandBase.Execute is abstract and must be overridden, and you should pin the package version before long-term reliance.