uno-toolkit-command-extensions

Bind UI controls to MVVM commands via attached properties in XAML.

9|1|Updated Dec 10, 2024
One-click install
npx skills add https://github.com/unoplatform/studio --skill uno-toolkit-command-extensions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: uno-toolkit-command-extensions
Source: https://github.com/unoplatform/studio/tree/main/plugins/uno-platform-studio/skills/uno-toolkit-command-extensions
Command: npx skills add https://github.com/unoplatform/studio --skill uno-toolkit-command-extensions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

UI development often requires wiring events to MVVM commands, which can lead to code-behind and brittle bindings. This skill provides attached properties to bind commands to various controls without a built-in Command.

Core Features & Use Cases

  • Attaches CommandExtensions.Command and CommandExtensions.CommandParameter to controls to invoke MVVM commands.
  • Supports common UI interactions: TextBox Enter, ListView item click, ToggleSwitch, NavigationView invocations, UIElement taps.
  • Use case: Bind a button click or list item tap to a ViewModel command without code-behind.

Quick Start

Add the attached properties to your XAML controls to bind them to your ViewModel commands without code-behind.

Frequently Asked Questions about uno-toolkit-command-extensions

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

FAQPage Schema
How do I bind MVVM commands to UI controls in XAML without using code-behind event handlers?

You can bind MVVM commands to UI controls without code-behind by applying the CommandExtensions.Command and CommandExtensions.CommandParameter attached properties directly in XAML.

What is the best way to handle ListView item clicks or TextBox Enter key events in an MVVM pattern?

The best way to handle ListView item clicks and TextBox Enter events in an MVVM pattern is using attached properties to bind these interactions directly to ViewModel commands.

Can I attach commands to ToggleSwitch and NavigationView controls in Uno Platform?

Yes, you can attach commands to ToggleSwitch and NavigationView controls in Uno Platform by setting the CommandExtensions.Command attached property in your XAML markup.

Why do I need attached properties for command binding on UI elements like a toggle switch?

Attached properties are needed for command binding because controls like ToggleSwitch and ListView lack a built-in Command property, requiring XAML extensions to invoke ViewModel commands.

Does the Uno Toolkit command extensions approach work for generic UIElement taps?

Yes, the Uno Toolkit command extensions approach works for generic UIElement taps, along with TextBox Enter, ListView clicks, and NavigationView invocations, by using attached properties.