> For the complete documentation index, see [llms.txt](https://framework.aic.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://framework.aic.io/technical-guidelines-code-standards-and-tech-stack/tech-stack/desktop-stack-wpf.md).

# Desktop Stack WPF

## Purpose

WPF is AIC's standard option for Windows-only desktop applications that require rich native UI, mature Windows integration, complex data entry, offline workflows, or controlled enterprise deployment.

## When to Use WPF

Use WPF when:

* the application is Windows-only
* the customer requires desktop deployment
* advanced data entry or rich UI is needed
* local hardware integration is required
* offline operation is required
* strong Windows identity integration is required
* mature XAML tooling is valuable

{% hint style="warning" %}
Do not use WPF for new cross-platform requirements. Use .NET MAUI or a web application instead.
{% endhint %}

## Architecture Standard

AIC WPF applications MUST use MVVM or a closely related separation pattern.

Recommended layers:

```
Aic.Product.Desktop
Aic.Product.Presentation
Aic.Product.Application
Aic.Product.Domain
Aic.Product.Infrastructure
Aic.Product.Desktop.Tests
```

## Mandatory WPF Rules

* No business logic in code-behind.
* ViewModels must be testable without UI automation.
* Long-running work must not block the UI thread.
* Commands must expose can-execute behaviour where relevant.
* Bindings must be reviewed for runtime errors.
* UI state must be explicit and testable.
* Accessibility must be considered for customer-facing applications.
* Local storage must be encrypted where it contains sensitive data.

## Preferred Libraries

AIC may use:

* CommunityToolkit.Mvvm for MVVM primitives
* Microsoft.Extensions.DependencyInjection for dependency injection
* Microsoft.Extensions.Configuration for configuration
* Microsoft.Extensions.Logging or Serilog for logging
* OpenTelemetry-compatible logging where appropriate

All libraries require licensing and security approval.

## WPF Quality Gate

Before release:

* startup and shutdown tested
* UI thread responsiveness tested
* error handling tested
* logging verified
* deployment package tested
* update path tested
* accessibility reviewed
* offline behaviour tested if applicable
* secrets and local data storage reviewed
