Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

winforms

/winforms

Pomaga tworzyć, utrzymywać i modernizować aplikacje Windows Forms: projektanci UI, obsługę zdarzeń, wiązanie danych i migrację do .NET.

Repozytorium
dotnet-skills ↗
Licencja
MIT
Ostatnia zmiana repozytorium
26.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
4
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Pomaga tworzyć, utrzymywać i modernizować aplikacje Windows Forms: projektanci UI, obsługę zdarzeń, wiązanie danych i migrację do .NET.

Oryginalny opis (EN)

Build, maintain, or modernize Windows Forms applications with practical guidance on designer-driven UI, event handling, data binding, MVP separation, and migration to modern .NET. USE FOR: working on Windows Forms UI, event-driven workflows, or classic LOB applications; migrating WinForms from .NET Framework to modern .NET; cleaning up oversized form code. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.

Jak działa

  1. Trigger On
  2. Workflow
  3. Current Upstream Notes
  4. Key Decisions
  5. Deliver
  6. Validate
  7. References
Sekcje z nagłówków SKILL.md, w oryginale · 96 linii, 556 słów
Podgląd SKILL.md
---
name: winforms
description: "Build, maintain, or modernize Windows Forms applications with practical guidance on designer-driven UI, event handling, data binding, MVP separation, and migration to modern .NET. USE FOR: working on Windows Forms UI, event-driven workflows, or classic LOB applications; migrating WinForms from .NET Framework to modern .NET; cleaning up oversized form code. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made."
compatibility: "Requires a Windows Forms project on .NET or .NET Framework."
---

# Windows Forms

## Trigger On

- working on Windows Forms UI, event-driven workflows, or classic LOB applications
- migrating WinForms from .NET Framework to modern .NET
- cleaning up oversized form code or designer coupling
- implementing data binding, validation, or control customization

## Workflow

1. **Respect designer boundaries** — never edit `.Designer.cs` directly; changes are lost on regeneration.
2. **Separate business logic from forms** — use MVP (Model-View-Presenter) pattern. Forms orchestrate UI; presenters contain logic; services handle data access.
   ```csharp
   // View interface — forms implement this
   public interface ICustomerView
   {
       string CustomerName { get; set; }
       event EventHandler SaveRequested;
       void ShowError(string message);
   }

   // Presenter — testable without UI
   public class CustomerPresenter
   {
       private readonly ICustomerView _view;
       private readonly ICustomerService _service;
       public CustomerPresenter(ICustomerView view, ICustomerService service)
       {
           _view = view;
           _service = service;
           _view.SaveRequested += async (s, e) =>
           {
               try { await _service.SaveAsync(_view.CustomerName); }
               catch (Exception ex) { _view.ShowError(ex.Message); }
           };
       }
   }
   ```
3. **Use DI from Program.cs** (.NET 6+):
   ```csharp
   var services = new ServiceCollection();
   services.AddSingleton<ICustomerService, CustomerService>();
   services.AddTransient<MainForm>();
   using var sp = services.BuildServiceProvider();
   Application.Run(sp.GetRequiredService<MainForm>());
   ```
4. **Use data binding** via `BindingSource` and `INotifyPropertyChanged` instead of manual control population. See [references/patterns.md](references/patterns.md) for complete binding patterns.
5. **Use async/await** for I/O operations — disable controls during loading, use `Progress<T>` for progress reporting. Never block the UI thread.
6. **Validate with `ErrorProvider`** and the `Validating` event. Call `ValidateChildren()` before save operations.
7. **Modernize incrementally** — prefer better structure over big-bang rewrites. Use .NET 8+ features (button commands, stock icons) when available.

## Current Upstream Notes

- The August 2026 Windows Forms overview remains focused on Windows desktop, designer-driven controls, events, data binding, and migration to modern .NET. It does not change the framework-selection guidance: improve form boundaries and designer safety before proposing a rewrite.
- For docs-driven updates, validate whether the app targets .NET Framework, modern .NET, or mixed libraries before changing project format, designer files, or deployment assumptions.

```mermaid
flowchart LR
  A["Form event"] --> B["Presenter handles logic"]
  B --> C["Service layer / data access"]
  C --> D["Update view via interface"]
  D --> E["Validate and display results"]
```

## Key Decisions

| Decision | Guidance |
|----------|----------|
| MVP vs MVVM | Prefer MVP for WinForms — simpler with event-driven model |
| BindingSource vs manual | Always prefer BindingSource for list/detail binding |
| Sync vs async I/O | Always async — use `async void` only for event handlers |
| Custom controls | Extract reusable `UserControl` when form grows beyond ~300 lines |
| .NET Framework → .NET | Use the official migration guide; validate designer compatibility first |

## Deliver

- less brittle form code with clear UI/logic separation
- MVP pattern with testable presenters
- pragmatic modernization guidance for WinForms-heavy apps
- data binding and validation patterns that reduce manual wiring

## Validate

- designer files stay stable and are not hand-edited
- forms are not acting as the application service layer
- async operations do not block the UI thread
- validation is implemented consistently with ErrorProvider
- Windows-only runtime behavior is tested on target

## References

- [references/patterns.md](references/patterns.md) - WinForms architectural patterns (MVP, MVVM, Passive View), data binding, validation, form communication, threading, DI setup, and .NET 8+ features
- [references/migration.md](references/migration.md) - step-by-step migration from .NET Framework to modern .NET, common issues, deployment options, and gradual migration strategies
Pliki w paczce (4)
  • SKILL.md 5 KB
  • manifest.json 1 KB
  • references/migration.md 13 KB
  • references/patterns.md 17 KB

Wersje

W bazie nie ma innych skilli o nazwie winforms.

Migawka bazy z 13.11.2026 · wersja paczki 9c9180c6998e (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100wpf
    Buduje i modernizuje aplikacje WPF na .NET: poprawny XAML, wiązanie danych, polecenia, wątki i migrację z .NET Framework.
  • 100winui
    Buduje lub recenzuje aplikacje WinUI 3 z Windows App SDK: MVVM, pakowanie, nawigację, motyw oraz wybór między WPF i MAUI.
  • 100winforms-expert
    Tworzy, poprawia, debuguje i recenzuje aplikacje WinForms, gdy zapytanie zawiera konkretne oznaczenia WinForms, na przykład pliki Designer.cs.
  • 100vbnet
    Pomaga utrzymywać i modernizować aplikacje Visual Basic .NET: LINQ, WinForms, WPF, ASP.NET oraz migracje korporacyjnych systemów .NET.
  • 90desktop-winforms
    Pomaga w rozwoju i utrzymaniu aplikacji Windows Forms: kontrolki, rysowanie GDI+ i starszych projektów desktopowych w .NET.
  • 93download-sdk
    Prowadzi przez pobieranie i instalację podglądowych runtime .NET wymaganych przez repozytorium WinForms.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.