
Description
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 existing MVVM code or when guided by winforms-feature-adoption scenario. DO NOT USE FOR: automatic application during version upgrades (opt-in only).
SKILL.md
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+,
CommandProperty) - 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
ICommandwithRelayCommandon ViewModel side - Working around
ObservableCollectionin WinForms contexts - Setting up dependency injection with ViewModels
- Creating .datasource files for ViewModel Designer support
- Troubleshooting ViewModel code generation issues
Related Skills
- 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.
More skills from the upgrade-agent-plugins repository
View all 19 skillsconverting-to-cpm
migrate .NET projects to Central Package Management
Jul 18.NETMicrosoftMigrationcreating-winforms-custom-controls
create custom WinForms controls
Jul 3.NETWindowsWinUImanaging-winforms-high-dpi-layout
design high-DPI responsive WinForms layouts
Jul 18DesignDesktopUI ComponentsWindowsmigrating-aspnet-framework-to-core
migrate ASP.NET Framework to Core
Jul 3.NETASP.NET CoreBackendMigrationmigrating-documentdb-to-cosmos
migrate DocumentDB to Cosmos DB
Jul 3AzureCosmos DBDatabaseMigrationmigrating-global-asax
migrate Global.asax to ASP.NET Core middleware
Jul 7ASP.NET CoreMicrosoftMigrationModernization
More from Microsoft
View publisherplaywright-trace
inspect Playwright trace files
playwright
Apr 6DebuggingPlaywrightTestingrushstack-best-practices
manage Rush monorepos with best practices
rushstack
Apr 6EngineeringLocal DevelopmentMicrosoftProject Management +1azure-ai-agents-persistent-dotnet
build AI agents with Azure .NET SDK
skills
Jul 3.NETAgentsAzureLLMazure-ai-anomalydetector-java
build anomaly detection applications with Java
skills
May 13AnalyticsAzureData AnalysisJava +2azure-ai-contentsafety-java
build content moderation applications with Azure AI
skills
Jul 7AI InfrastructureAzureJavaSecurityazure-ai-contentsafety-py
detect harmful content with Azure AI Content Safety
skills
Jul 18AzureComplianceLLMMicrosoft +2