dotnet-wpf-modern

Guide WPF application development on .NET 8+ with MVVM and dependency injection.

71|10|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-wpf-modern-wshaddix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-wpf-modern
Source: https://github.com/wshaddix/dotnet-skills/tree/main/skills/dotnet-wpf-modern
Command: npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-wpf-modern-wshaddix

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill helps developers build modern, performant, and maintainable WPF applications using the latest .NET features and best practices.

Core Features & Use Cases

  • Modern Project Setup: Utilize SDK-style projects, implicit usings, and nullable reference types.
  • Dependency Injection: Implement DI using the generic host builder pattern.
  • MVVM with Source Generators: Leverage CommunityToolkit.Mvvm for cleaner ViewModel code.
  • Performance Optimizations: Benefit from hardware-accelerated rendering, ReadyToRun, and GC improvements.
  • Theming: Implement modern Fluent themes (.NET 9+) or custom themes.
  • Use Case: Create a new WPF application that uses the MVVM pattern, injects services for data access, and has a clean, modern UI with support for dark mode.

Quick Start

Create a new WPF application using the .NET 8 SDK-style project template and configure the host builder for dependency injection.

Frequently Asked Questions about dotnet-wpf-modern

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 on .NET 8?

To set up dependency injection in WPF on .NET 8, configure the generic host builder in your App.xaml.cs. This pattern allows you to register and inject services for data access directly into your ViewModels.

What is the best way to implement MVVM in WPF with modern C#?

The best way to implement MVVM in modern WPF is using CommunityToolkit.Mvvm. It leverages source generators to produce cleaner ViewModel code, reducing boilerplate for property change notifications and commands.

Does WPF on .NET 9 support Fluent themes and dark mode?

Yes, WPF on .NET 9 introduces the modern Fluent theme. You can implement this theme or custom themes to provide a clean, modern UI with built-in support for dark mode.

How does hardware-accelerated rendering improve WPF performance on .NET 8?

Hardware-accelerated rendering on .NET 8 improves WPF performance by utilizing the GPU for drawing. Combined with ReadyToRun and GC improvements, it ensures smoother UI rendering and faster startup.

Can I use SDK-style projects and nullable reference types for WPF development?

Yes, modern WPF development on .NET 8 utilizes SDK-style projects, implicit usings, and nullable reference types. This setup streamlines project configuration and enforces null safety across your application.

Do I need the Windows desktop workload to build WPF applications on .NET 8?

Yes, you need the .NET 8.0+ SDK with the Windows desktop workload installed to build WPF applications. This workload provides the necessary libraries and templates for desktop UI development.