reactor-commanding

Coordinate shared commands across menus, toolbars, and context surfaces in Reactor.

609|44|Updated Apr 16, 2026
One-click install
npx skills add https://github.com/microsoft/microsoft-ui-reactor --skill reactor-commanding
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: reactor-commanding
Source: https://github.com/microsoft/microsoft-ui-reactor/tree/main/plugins/reactor/skills/reactor-commanding
Command: npx skills add https://github.com/microsoft/microsoft-ui-reactor --skill reactor-commanding

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Coordinating shared commands across menus, toolbars, and context surfaces in Reactor is repetitive and error-prone when implemented ad-hoc. This Skill provides a consistent pattern using Command, StandardCommand, UseCommand, and CommandHost to unify actions, shortcuts, and enabled states.

Core Features & Use Cases

  • Centralized command definitions that can be reused across menus, toolbars, and app bars.
  • Simplified keyboard shortcut integration and CanExecute state management for common actions.
  • Context sharing via a lightweight provider to propagate command instances.

Quick Start

Define a shared command once and attach it to MenuItem, AppBarButton, and Button components.

Frequently Asked Questions about reactor-commanding

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

FAQPage Schema
How do I share commands across menus and toolbars in WinUI without duplicating code?

You can centralize command definitions using a pattern with Command and StandardCommand instances, then attach them to MenuItem and AppBarButton components. This unifies actions, keyboard shortcuts, and CanExecute state management across multiple surfaces.

What is the best way to manage keyboard shortcuts and CanExecute state for shared actions in a Reactor app?

Managing keyboard shortcuts and CanExecute state is handled by defining shared commands once and propagating them via a lightweight context provider. This ensures consistent enabled states and shortcut handling across menus, toolbars, and app bars.

How do I define a shared command once and attach it to multiple UI surfaces in Reactor?

Define a shared command using Command or StandardCommand, then attach that single instance to MenuItem, AppBarButton, and Button components. A CommandHost integrates the instances, while context sharing propagates them across surfaces.

Do I need a CommandHost to coordinate actions across context surfaces in WinUI?

A CommandHost is used for optional integration to coordinate shared actions across context surfaces. While you can define commands directly, using a CommandHost with a context provider streamlines instance propagation and state management.

Why does my CanExecute state fail to sync across different toolbars and context menus?

CanExecute state fails to sync when commands are implemented ad-hoc instead of centralized. Defining shared commands through a unified pattern and propagating them via a context provider ensures consistent enabled states across all surfaces.

When should I unify command handling instead of wiring up individual menu and toolbar actions?

You should unify command handling whenever an app requires consistent actions, keyboard shortcuts, and CanExecute states across multiple surfaces. Centralizing prevents the repetitive and error-prone issues of ad-hoc implementations.