mcpbeat

Managing Winforms Mvvm

microsoft/managing-winforms-mvvm

> Implements MVVM pattern in WinForms applications (.NET 8+) with ViewModels, Commands, and DataContext. Use when user explicitly requests MVVM implementation, setting up ViewModel with INotifyPropertyChanged or ObservableObject, implementing ICommand or RelayCommand, wiring Form.DataContext, binding controls to ViewModel properties, creating Commands for button clicks, or separating business logic from UI code. Also triggers for "WinForms MVVM", "ViewModel in WinForms", "INotifyPropertyChanged", "DataContext binding", "Command pattern WinForms", "ObservableObject", "RelayCommand", and "testable WinForms". Also use when fixing automatic application during version upgrades (opt-in only).

6k tokens
context cost
the whole folder, loaded on every use
2
files
instructions only
0
copies elsewhere
how many repositories repackaged it
17
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/microsoft/upgrade-agent-plugins --skill managing-winforms-mvvm

What comes with it

22 102 bytes besides the instruction
ref/detailed-guide.md

The instruction itself

5 sections, as written by the author

WinForms MVVM Pattern Guide

MVVM (Model-View-ViewModel) pattern in WinForms (.NET 8+) enables separation of business logic from UI, creating applications that are testable, maintainable, and portable across UI frameworks.

When to Use This Skill

Use this skill when:

  • Working with DataBinding in WinForms .NET 8+
  • Implementing MVVM pattern in WinForms in .NET 8+ applications
  • Creating ViewModels with MVVM Community Toolkit
  • Setting up Command binding for buttons and menus (.NET 8+, Command Property)
  • Using DataContext property for hierarchical binding (.NET 8+)
  • Migrating from traditional event-handler architecture to MVVM
  • Writing unit tests for business logic
  • Sharing ViewModels between WinForms and WPF/MAUI/Avalonia
  • Implementing ICommand with RelayCommand on ViewModel side
  • Working around ObservableCollection in WinForms contexts
  • Setting up dependency injection with ViewModels
  • Creating .datasource files for ViewModel Designer support
  • Troubleshooting ViewModel code generation issues
  • WinForms Development
  • WinForms Data Binding
  • WinForms Designer Code
  • WinForms Async APIs
  • WinForms High-DPI Fluent Layout

Detailed Guidance

Read Detailed guide for comprehensive patterns, examples, and troubleshooting.

Workflow

  • Confirm the scenario matches the triggers in this skill.
  • Apply the baseline pattern from this file.
  • Read Detailed guide for advanced or edge-case handling.
  • Validate changes with an actual build and runtime check.

How to use it

Copy the folder

Take microsoft/managing-winforms-mvvm from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.