OpenParable
Skip to content
← Back to skills

windows-xaml-developer

Development

Expert guidance on building modern Windows apps with WinUI 3, WPF, and the MVVM pattern.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/majiayu000/claude-skill-registry/blob/HEAD/skills/data/windows-xaml-developer/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/windows-xaml-developer, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Windows XAML Developer

Overview

This skill provides best practices, architectural patterns, and library recommendations for building high-quality Windows desktop applications using XAML-based frameworks (WinUI 3 and WPF). It emphasizes the Model-View-ViewModel (MVVM) pattern, Dependency Injection (DI), and modern C# features.

When to Use

  • When generating code for Windows desktop applications (WinUI 3, WPF, UWP).
  • When structuring a new Windows XAML project.
  • When implementing the MVVM pattern.
  • When troubleshooting XAML binding or UI responsiveness issues.

Core Principles

  1. MVVM First: Always separate UI logic (View) from business logic (ViewModel). Avoid code-behind (.xaml.cs) except for pure UI concerns (e.g., window manipulation).
  2. Dependency Injection: Use DI to manage services and ViewModels. Avoid static singletons for testability.
  3. Responsive UI: Never block the UI thread. Use async/await for I/O and heavy computations.
  4. Modern Tooling: Leverage Roslyn source generators (e.g., CommunityToolkit.Mvvm) to reduce boilerplate.

Recommended Tech Stack

Frameworks

  • Primary: WinUI 3 (Windows App SDK) - The modern, native UI stack for Windows. Best for new applications.
  • Secondary: WPF (.NET 8/9) - Mature, stable ecosystem. Best for complex enterprise apps or when specific third-party controls are needed.

Essential Libraries

CategoryLibraryUsage
MVVMCommunityToolkit.MvvmStandard implementation for ObservableObject, RelayCommand, and Messenger.
Dependency InjectionMicrosoft.Extensions.DependencyInjectionIndustry-standard DI container.
Hosting/LifecycleMicrosoft.Extensions.HostingApplication bootstrap, logging, and configuration.
WPF UI LibraryMaterialDesignInXamlToolkit or MahApps.Metro(WPF Only) Modern styling and controls.
WinUI HelpersCommunityToolkit.WinUIAdditional controls, helpers, and extensions for WinUI 3.

Project Structure

Organize the solution to enforce strict separation of concerns:

MyWindowsApp/
├── App.xaml                 # Application entry & DI composition root
├── Views/                   # XAML Windows, Pages, and UserControls
├── ViewModels/              # C# ViewModels (one per View)
├── Models/                  # Domain entities and data structures
├── Services/                # Business logic and data access interfaces/implementations
├── Converters/              # IValueConverter implementations
└── Assets/                  # Images, fonts, and resources