wshaddix/dotnet-skills/dotnet-wpf-modern
Claude Code and agent skill by wshaddix/dotnet-skills
- community
Checking that the SKILL.md file is still in the repository.
Building WPF on .NET 8+. Host builder, MVVM Toolkit, Fluent theme, performance, modern C# patterns.
Install
npx vskill@latest install wshaddix/dotnet-skills/dotnet-wpf-modernSKILL.md
dotnet-wpf-modern
WPF on .NET 8+: Host builder and dependency injection, MVVM with CommunityToolkit.Mvvm source generators, hardware-accelerated rendering improvements, modern C# patterns (records, primary constructors, pattern matching), Fluent theme (.NET 9+), system theme detection, and what changed from .NET Framework WPF.
Version assumptions: .NET 8.0+ baseline (current LTS). TFM net8.0-windows. .NET 9 features (Fluent theme) explicitly marked.
Scope boundary: This skill owns WPF on modern .NET patterns: Host builder, MVVM Toolkit, performance, modern C#, theming. Migration from .NET Framework to .NET 8+ is owned by [skill:dotnet-wpf-migration]. Desktop testing is owned by [skill:dotnet-ui-testing-core].
Out of scope: WPF .NET Framework patterns (legacy) -- this skill covers .NET 8+ only. Migration guidance -- see [skill:dotnet-wpf-migration]. Desktop testing -- see [skill:dotnet-ui-testing-core]. General Native AOT patterns -- see [skill:dotnet-native-aot]. UI framework selection -- see [skill:dotnet-ui-chooser].
Cross-references: [skill:dotnet-ui-testing-core] for desktop testing, [skill:dotnet-winui] for WinUI 3 patterns, [skill:dotnet-wpf-migration] for migration guidance, [skill:dotnet-native-aot] for general AOT, [skill:dotnet-ui-chooser] for framework selection, [skill:dotnet-accessibility] for accessibility patterns (AutomationProperties, AutomationPeer, UI Automation).
.NET 8+ Differences
WPF on .NET 8+ is a significant modernization from .NET Framework WPF. The project format, DI pattern, language features, and runtime behavior have all changed.
New Project Template
Key differences from .NET Framework WPF:
- SDK-style
.csproj(nopackages.config, noAssemblyInfo.cs) - Nullable reference types enabled by default
- Implicit usings enabled
- NuGet
PackageReferenceformat (notpackages.config) - No
App.configfor DI -- use Host builder dotnet publishproduces a single deployment artifact- Side-by-side .NET installation (no machine-wide framework dependency)
Host Builder Pattern
Modern WPF apps use the generic host for dependency injection, configuration, and logging -- replacing the legacy ServiceLocator or manual DI approaches.
MVVM Toolkit
CommunityToolkit.Mvvm (Microsoft MVVM Toolkit) is the recommended MVVM framework for modern WPF. It uses source generators to eliminate boilerplate.
XAML Binding with MVVM Toolkit
Key source generator attributes:
[ObservableProperty]-- generates property withINotifyPropertyChangedfrom a backing field[RelayCommand]-- generatesICommandfrom a method (supports async, cancellation,CanExecute)[NotifyPropertyChangedFor]-- raisesPropertyChangedfor dependent properties[NotifyCanExecuteChangedFor]-- re-evaluates commandCanExecutewhen property changes
Performance
WPF on .NET 8+ delivers significant performance improvements over .NET Framework WPF.
Hardware-Accelerated Rendering
- DirectX 11 rendering path is the default on .NET 8+ (up from DirectX 9 on .NET Framework)
- GPU-accelerated text rendering improves text clarity and reduces CPU usage for text-heavy UIs
- Reduced GC pressure from runtime improvements (dynamic PGO, on-stack replacement)
Startup Time
- ReadyToRun (R2R) -- pre-compiled assemblies reduce JIT overhead at startup
- Tiered compilation -- fast startup with progressive optimization
- Trimming readiness --
.NET 8+WPF supports IL trimming for smaller deployment size
Trimming caveat: WPF relies heavily on XAML reflection for data binding and resource resolution. Use TrimMode=partial (not full) and test thoroughly. Compiled bindings and x:Type references are safer than string-based bindings for trimming.
Memory and GC
- Frozen object heap (.NET 8) -- static strings and singleton allocations placed on non-collected heap segments
- Dynamic PGO -- runtime profiles guide JIT optimizations for hot paths
- Reduced working set -- .NET 8 runtime uses less baseline memory than .NET Framework CLR
Expected Improvements
WPF on .NET 8 delivers measurable improvements over .NET Framework 4.8 across key metrics. Exact numbers depend on workload, hardware, and application complexity -- always benchmark your own scenarios:
- Cold startup -- significantly faster due to ReadyToRun, tiered compilation, and reduced framework initialization overhead
- UI virtualization -- improved rendering pipeline and GC reduce time for large ItemsControls (ListBox, DataGrid)
- GC pauses -- shorter and less frequent Gen2 collections from .NET 8 GC improvements (Dynamic PGO, frozen object heap, pinned object heap)
- Memory footprint -- lower baseline working set compared to .NET Framework CLR
Modern C#
.NET 8+ WPF projects can use the latest C# language features. These patterns reduce boilerplate and improve code clarity.
Records for Data Models
Primary Constructors in Services
Pattern Matching in Converters
Collection Expressions
Theming
Fluent Theme (.NET 9+)
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/dotnet-wpf-modern/SKILL.md
Popularity
- Repository stars
- 50
- Repository forks
- 6
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 18 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/wshaddix/dotnet-skills/dotnet-wpf-modern)