dotnet-patterns

Implement and test DI, MVVM, and async patterns in .NET 6+ applications.

2|1|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/solitasroh/mcukit --skill dotnet-patterns-solitasroh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-patterns
Source: https://github.com/solitasroh/mcukit/tree/main/skills/dotnet-patterns
Command: npx skills add https://github.com/solitasroh/mcukit --skill dotnet-patterns-solitasroh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides practical guidance for implementing and testing essential .NET patterns, including dependency injection, MVVM structuring, and asynchronous programming, in WPF and general .NET projects.

Core Features & Use Cases

  • Dependency Injection scaffolding using Microsoft.Extensions.DependencyInjection for decoupled, testable services.
  • MVVM pattern guidance for ViewModel design and unit testing with xUnit, enabling maintainable UI logic.
  • Async/await pattern usage for robust data loading, service calls, and responsive UI.
  • Configuration recommendations for .NET and WPF projects to improve maintainability and testability.

Quick Start

Install the skill and refer to the provided DI, MVVM, and async samples to bootstrap a testable .NET WPF application.

Frequently Asked Questions about dotnet-patterns

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

FAQPage Schema
How do I set up dependency injection in a WPF application?

Set up dependency injection in WPF using Microsoft.Extensions.DependencyInjection to configure decoupled, testable services. This approach provides practical scaffolding to register and resolve dependencies, improving the maintainability of your general .NET projects.

What's the best way to unit test ViewModels in WPF using xUnit?

Unit test ViewModels in WPF using xUnit by applying the MVVM pattern for structured UI logic. This enables maintainable and testable UI logic separation, allowing you to verify asynchronous data flows and service calls effectively.

How do I handle asynchronous data loading in .NET without freezing the UI?

Handle asynchronous data loading in .NET using async/await patterns for robust service calls and responsive UI. This ensures your WPF application remains responsive during data operations by properly structuring asynchronous data flows.

Do I need .NET 6 to use Microsoft.Extensions.DependencyInjection for MVVM testability?

Yes, you need .NET 6 or later to implement structured DI and testable ViewModels using Microsoft.Extensions.DependencyInjection. This version requirement ensures proper compatibility for configuring DI scaffolding and executing xUnit tests.

Why should I use MVVM patterns instead of putting logic directly in WPF code-behind?

Use MVVM patterns instead of WPF code-behind to achieve decoupled, testable ViewModels and structured UI logic. This approach enables maintainable applications by separating UI presentation from business logic and facilitating unit testing with xUnit.