# dotnet/wpf architecture

> Architecture diagram of the GitHub repository dotnet/wpf, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dotnet/wpf
- Repository: https://github.com/dotnet/wpf

## Overview

WPF is a Windows desktop UI framework. An application uses the application model and XAML to construct an interface, whose controls, layout, resources, and data binding support interactive presentation; graphics and documents provide additional user-facing capabilities. WindowsBase supplies foundational properties, objects, and dispatching, while PresentationCore and WpfGfx support media and rendering. The README documents these capabilities, but the excerpts do not expose most runtime call paths, so undocumented connections are omitted. The template-to-application link is supported by the source index.

Main entry points: [`src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Application.cs`](https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Application.cs) (Application model), [`src/Microsoft.DotNet.Wpf/src/PresentationFramework`](https://github.com/dotnet/wpf/tree/main/src/Microsoft.DotNet.Wpf/src/PresentationFramework) (Controls and layout), [`src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/DependencyObject.cs`](https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/DependencyObject.cs) (Dependency properties), [`packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/net6.0/App.xaml.cs`](https://github.com/dotnet/wpf/blob/main/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/net6.0/App.xaml.cs) (Project templates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application model"]
  node_appmodel["Application model<br/>[Application.cs]"]
  node_templates["Project templates<br/>[App.xaml.cs]"]
end

subgraph group_framework["UI framework"]
  node_controls["Controls and layout"]
  node_resources["Resources<br/>[Application.cs]"]
  node_binding["Data binding<br/>[DataBindEngine.cs]"]
  node_documents["Documents and search<br/>[TextFindEngine.cs]"]
end

subgraph group_foundation["Core foundation"]
  node_propertysystem["Dependency properties"]
  node_propertyregistry["Property registry"]
  node_metadata["Property metadata"]
  node_dispatch["UI dispatching<br/>[Dispatcher.cs]"]
end

subgraph group_presentation["Presentation services"]
  node_graphics["Vector graphics<br/>[engine.cpp]"]
  node_media["Media and animation<br/>[Media]"]
  node_fontembed["Font embedding"]
  node_packaging[("Document packaging<br/>[StorageInfo.cs]")]
  node_automation["Automation input<br/>[Input.cs]"]
end

node_developer(("Application developer"))

node_developer -->|"starts from"| node_templates
node_developer -->|"builds with"| node_appmodel
node_templates -->|"uses"| node_appmodel
node_appmodel -->|"fetches resources"| node_resources
node_appmodel -.->|"hosts interface"| node_controls
node_appmodel -.->|"uses binding"| node_binding
node_appmodel -.->|"presents documents"| node_documents
node_controls -.->|"uses properties"| node_propertysystem
node_propertysystem -.->|"resolves properties"| node_propertyregistry
node_metadata -.->|"configures properties"| node_propertysystem
node_binding -->|"marshals work"| node_dispatch
node_controls -.->|"renders interface"| node_graphics
node_graphics -.->|"hosts media"| node_media
node_documents -.->|"packages content"| node_packaging
node_media -->|"tracks glyph usage"| node_fontembed
node_developer -.->|"injects input"| node_automation

click node_appmodel "https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Application.cs"
click node_templates "https://github.com/dotnet/wpf/blob/main/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/net6.0/App.xaml.cs"
click node_controls "https://github.com/dotnet/wpf/tree/main/src/Microsoft.DotNet.Wpf/src/PresentationFramework"
click node_resources "https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Application.cs"
click node_binding "https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Data/DataBindEngine.cs"
click node_documents "https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Documents/TextFindEngine.cs"
click node_propertysystem "https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/DependencyObject.cs"
click node_propertyregistry "https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/DependencyProperty.cs"
click node_metadata "https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/FrameworkPropertyMetadata.cs"
click node_dispatch "https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/Dispatcher.cs"
click node_graphics "https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/WpfGfx/core/common/engine.cpp"
click node_media "https://github.com/dotnet/wpf/tree/main/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media"
click node_fontembed "https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/FontEmbeddingManager.cs"
click node_packaging "https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/IO/Packaging/CompoundFile/StorageInfo.cs"
click node_automation "https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/Input.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_appmodel,node_templates toneBlue
class node_controls,node_resources,node_binding,node_documents toneAmber
class node_propertysystem,node_propertyregistry,node_metadata,node_dispatch toneMint
class node_graphics,node_media,node_fontembed,node_packaging,node_automation toneRose
class node_developer toneIndigo
```

## Components

### Application model

- [Application model](https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Application.cs): `src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Application.cs`
- [Project templates](https://github.com/dotnet/wpf/blob/main/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/net6.0/App.xaml.cs): `packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/net6.0/App.xaml.cs`

### UI framework

- [Controls and layout](https://github.com/dotnet/wpf/tree/main/src/Microsoft.DotNet.Wpf/src/PresentationFramework): `src/Microsoft.DotNet.Wpf/src/PresentationFramework`
- [Resources](https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Application.cs): `src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Application.cs`
- [Data binding](https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Data/DataBindEngine.cs): `src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Data/DataBindEngine.cs`
- [Documents and search](https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Documents/TextFindEngine.cs): `src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Documents/TextFindEngine.cs`

### Core foundation

- [Dependency properties](https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/DependencyObject.cs): `src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/DependencyObject.cs`
- [Property registry](https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/DependencyProperty.cs): `src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/DependencyProperty.cs`
- [Property metadata](https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/FrameworkPropertyMetadata.cs): `src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/FrameworkPropertyMetadata.cs`
- [UI dispatching](https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/Dispatcher.cs): `src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/Dispatcher.cs`

### Presentation services

- [Vector graphics](https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/WpfGfx/core/common/engine.cpp): `src/Microsoft.DotNet.Wpf/src/WpfGfx/core/common/engine.cpp`
- [Media and animation](https://github.com/dotnet/wpf/tree/main/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media): `src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media`
- [Font embedding](https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/FontEmbeddingManager.cs): `src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/FontEmbeddingManager.cs`
- [Document packaging](https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/IO/Packaging/CompoundFile/StorageInfo.cs): `src/Microsoft.DotNet.Wpf/src/WindowsBase/System/IO/Packaging/CompoundFile/StorageInfo.cs`
- [Automation input](https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/Input.cs): `src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/Input.cs`

### Other components

- **Application developer**

## Connections

- Application developer → Project templates: starts from
- Application developer → Application model: builds with
- Project templates → Application model: uses (evidence: `packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/net6.0/App.xaml.cs`)
- Application model → Resources: fetches resources (evidence: `src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Application.cs`)
- Application model → Controls and layout: hosts interface (evidence: `src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Application.cs`)
- Application model → Data binding: uses binding
- Application model → Documents and search: presents documents
- Controls and layout → Dependency properties: uses properties (evidence: `src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Data/DataBindEngine.cs`)
- Dependency properties → Property registry: resolves properties (evidence: `src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/DependencyObject.cs`)
- Property metadata → Dependency properties: configures properties
- Data binding → UI dispatching: marshals work (evidence: `src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Data/DataBindEngine.cs`)
- Controls and layout → Vector graphics: renders interface
- Vector graphics → Media and animation: hosts media
- Documents and search → Document packaging: packages content
- Media and animation → Font embedding: tracks glyph usage (evidence: `src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/FontEmbeddingManager.cs`)
- Application developer → Automation input: injects input
