winforms

Implements WinForms data binding, validation, and async thread-safety patterns for .NET Framework 4.7.2.

Updated Aug 24, 2026
One-click install
npx skills add https://github.com/aggutierrez98/TP-TD --skill winforms-aggutierrez98
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: winforms
Source: https://github.com/aggutierrez98/TP-TD/tree/main/.agents/skills/winforms
Command: npx skills add https://github.com/aggutierrez98/TP-TD --skill winforms-aggutierrez98

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Applying generic WinForms guidance to a legacy .NET Framework 4.7.2 project often introduces incompatible patterns like MVP presenters, IServiceCollection-based DI, or .NET 6+ APIs. This Skill filters those patterns so UI code stays consistent with the project's layered architecture and manual CompositionRoot. ## Core Features & Use Cases - Data Binding Guidance: Use BindingSource and INotifyPropertyChanged on business entities instead of manually populating controls in event handlers. - Form Validation: Apply ErrorProvider with the Validating event and ValidateChildren() before submitting to the BLL, keeping UI validation separate from business rules. - Async & Thread Safety: Enforce async/await for I/O, disable controls during loads, and use Control.Invoke for cross-thread UI updates. - Use Case: When building a new data-entry Form, follow this Skill to wire a BindingSource to the grid, validate inputs inline with ErrorProvider, and call the BLL asynchronously without blocking the UI thread. ## Quick Start Apply the winforms skill to review this Form's data binding, validation, and async code for compliance with the project's .NET Framework 4.7.2 architecture.

Frequently Asked Questions about winforms

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

FAQPage Schema
How do I bind data to a DataGridView in WinForms?▼

Use a BindingSource as the intermediary: set BindingSource.DataSource to your collection, then assign it to DataGridView.DataSource. This enables filtering and navigation, and supports two-way binding when entities implement INotifyPropertyChanged.

How to validate WinForms input with ErrorProvider?▼

Handle each control's Validating event and call ErrorProvider.SetError to show inline messages. Before persisting, call ValidateChildren() to trigger all validations, keeping format checks in the UI and business rules in the BLL.

Can I use IServiceCollection dependency injection in .NET Framework 4.7.2 WinForms?▼

No, this project uses a manual CompositionRoot instead of IServiceCollection or third-party IoC containers. BLLs are constructed only in CompositionRoot with internal constructor injection, and Forms receive pre-resolved instances.

Why does my WinForms UI freeze during async operations?▼

Freezing happens when you block the UI thread with Task.Result or Task.Wait(). Use async/await for I/O calls, disable controls during the operation, re-enable them in a finally block, and use Control.Invoke for cross-thread updates.

Should WinForms Forms use an MVP presenter pattern?▼

Not in this project. MVP and Presenter classes are prohibited because the UI layer talks directly to the BLL via CompositionRoot, and adding a Presenter would violate the documented dependency matrix between layers.