# dotnet/maui architecture

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

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

## Overview

.NET MAUI is a cross-platform framework for building mobile and desktop applications with shared C# and XAML. The principal workflow starts with an application defining a window and controls; shared control and layout logic is then adapted by platform-specific handlers to native UI. The repository also contains graphics, platform services, compatibility renderers, and BlazorWebView hosting. Some relationships are documented or visible in sampled files; links to unsampled platform subsystems are marked unverified rather than treated as inspected call paths.

Main entry points: [`src/Controls/src/Core/View/View.cs`](https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/View/View.cs) (View controls), [`src/Controls/src/Core/Window/Window.cs`](https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/Window/Window.cs) (Window), [`src/Controls/src/Core/BindableObject.cs`](https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/BindableObject.cs) (Bindable properties), [`src/BlazorWebView/src/SharedSource/WebView2WebViewManager.cs`](https://github.com/dotnet/maui/blob/main/src/BlazorWebView/src/SharedSource/WebView2WebViewManager.cs) (WebView managers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application lifecycle"]
  node_app_model["Application model"]
  node_window["Window<br/>[Window.cs]"]
end

subgraph group_controls["Controls and layout"]
  node_bindable["Bindable properties<br/>[BindableObject.cs]"]
  node_property_def["Property definitions"]
  node_view["View controls<br/>[View.cs]"]
  node_visual_states["Visual states"]
  node_grid_layout["Grid layout"]
  node_drag_gestures["Drag gestures"]
end

subgraph group_runtime["Core runtime"]
  node_view_contract["View contract<br/>[IView.cs]"]
  node_dispatcher["Dispatcher<br/>[Dispatcher.cs]"]
  node_graphics["Graphics primitives"]
end

subgraph group_platform["Platform adaptation"]
  node_platform_handlers["Platform handlers"]
  node_android_platform["Android platform"]
  node_compat_renderers["Compatibility renderers"]
end

subgraph group_capabilities["Framework capabilities"]
  node_essentials["Device essentials"]
  node_blazor_view["Blazor WebView<br/>[BlazorWebView.cs]"]
  node_webview_manager["WebView managers"]
  node_static_content["Static content reload"]
end

node_developer(("App developer"))
node_platform_native["Native UI"]

node_developer -.->|"defines app"| node_app_model
node_app_model -.->|"provides window"| node_window
node_window -.->|"hosts content"| node_view
node_view -.->|"uses properties"| node_bindable
node_bindable -.->|"uses definitions"| node_property_def
node_visual_states -->|"applies setters"| node_bindable
node_visual_states -->|"references window"| node_window
node_view -.->|"implements view"| node_view_contract
node_grid_layout -->|"measures views"| node_view_contract
node_grid_layout -->|"uses size types"| node_graphics
node_view -.->|"hosts gestures"| node_drag_gestures
node_view -.->|"adapts controls"| node_platform_handlers
node_platform_handlers -.->|"creates native UI"| node_platform_native
node_android_platform -->|"handles drag events"| node_drag_gestures
node_compat_renderers -.->|"renders controls"| node_platform_native
node_developer -.->|"uses device APIs"| node_essentials
node_developer -.->|"hosts Blazor"| node_blazor_view
node_blazor_view -.->|"initializes WebView"| node_webview_manager
node_webview_manager -->|"supports reload"| node_static_content
node_dispatcher -->|"dispatches work"| node_webview_manager

click node_app_model "https://github.com/dotnet/maui/tree/main/src/Core/src/Hosting"
click node_window "https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/Window/Window.cs"
click node_bindable "https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/BindableObject.cs"
click node_property_def "https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/BindableProperty.cs"
click node_view "https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/View/View.cs"
click node_visual_states "https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/VisualStateManager.cs"
click node_grid_layout "https://github.com/dotnet/maui/blob/main/src/Core/src/Layouts/GridLayoutManager.cs"
click node_drag_gestures "https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/DragAndDrop/DragGestureRecognizer.cs"
click node_view_contract "https://github.com/dotnet/maui/blob/main/src/Core/src/Core/IView.cs"
click node_dispatcher "https://github.com/dotnet/maui/blob/main/src/Core/src/Dispatching/Dispatcher.cs"
click node_graphics "https://github.com/dotnet/maui/tree/main/src/Graphics/src/Graphics"
click node_platform_handlers "https://github.com/dotnet/maui/tree/main/src/Controls/src/Core/Handlers"
click node_android_platform "https://github.com/dotnet/maui/tree/main/src/Controls/src/Core/Platform/Android"
click node_compat_renderers "https://github.com/dotnet/maui/tree/main/src/Compatibility/Core/src"
click node_essentials "https://github.com/dotnet/maui/tree/main/src/Essentials/src"
click node_blazor_view "https://github.com/dotnet/maui/blob/main/src/BlazorWebView/src/Maui/BlazorWebView.cs"
click node_webview_manager "https://github.com/dotnet/maui/blob/main/src/BlazorWebView/src/SharedSource/WebView2WebViewManager.cs"
click node_static_content "https://github.com/dotnet/maui/blob/main/src/BlazorWebView/src/SharedSource/StaticContentHotReloadManager.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_app_model,node_window,node_platform_native toneBlue
class node_bindable,node_property_def,node_view,node_visual_states,node_grid_layout,node_drag_gestures toneAmber
class node_view_contract,node_dispatcher,node_graphics toneMint
class node_platform_handlers,node_android_platform,node_compat_renderers toneRose
class node_essentials,node_blazor_view,node_webview_manager,node_static_content,node_developer toneIndigo
```

## Components

### Application lifecycle

- [Application model](https://github.com/dotnet/maui/tree/main/src/Core/src/Hosting): `src/Core/src/Hosting`
- [Window](https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/Window/Window.cs): `src/Controls/src/Core/Window/Window.cs`

### Controls and layout

- [Bindable properties](https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/BindableObject.cs): `src/Controls/src/Core/BindableObject.cs`
- [Property definitions](https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/BindableProperty.cs): `src/Controls/src/Core/BindableProperty.cs`
- [View controls](https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/View/View.cs): `src/Controls/src/Core/View/View.cs`
- [Visual states](https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/VisualStateManager.cs): `src/Controls/src/Core/VisualStateManager.cs`
- [Grid layout](https://github.com/dotnet/maui/blob/main/src/Core/src/Layouts/GridLayoutManager.cs): `src/Core/src/Layouts/GridLayoutManager.cs`
- [Drag gestures](https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/DragAndDrop/DragGestureRecognizer.cs): `src/Controls/src/Core/DragAndDrop/DragGestureRecognizer.cs`

### Core runtime

- [View contract](https://github.com/dotnet/maui/blob/main/src/Core/src/Core/IView.cs): `src/Core/src/Core/IView.cs`
- [Dispatcher](https://github.com/dotnet/maui/blob/main/src/Core/src/Dispatching/Dispatcher.cs): `src/Core/src/Dispatching/Dispatcher.cs`
- [Graphics primitives](https://github.com/dotnet/maui/tree/main/src/Graphics/src/Graphics): `src/Graphics/src/Graphics`

### Platform adaptation

- [Platform handlers](https://github.com/dotnet/maui/tree/main/src/Controls/src/Core/Handlers): `src/Controls/src/Core/Handlers`
- [Android platform](https://github.com/dotnet/maui/tree/main/src/Controls/src/Core/Platform/Android): `src/Controls/src/Core/Platform/Android`
- [Compatibility renderers](https://github.com/dotnet/maui/tree/main/src/Compatibility/Core/src): `src/Compatibility/Core/src`

### Framework capabilities

- [Device essentials](https://github.com/dotnet/maui/tree/main/src/Essentials/src): `src/Essentials/src`
- [Blazor WebView](https://github.com/dotnet/maui/blob/main/src/BlazorWebView/src/Maui/BlazorWebView.cs): `src/BlazorWebView/src/Maui/BlazorWebView.cs`
- [WebView managers](https://github.com/dotnet/maui/blob/main/src/BlazorWebView/src/SharedSource/WebView2WebViewManager.cs): `src/BlazorWebView/src/SharedSource/WebView2WebViewManager.cs`
- [Static content reload](https://github.com/dotnet/maui/blob/main/src/BlazorWebView/src/SharedSource/StaticContentHotReloadManager.cs): `src/BlazorWebView/src/SharedSource/StaticContentHotReloadManager.cs`

### Other components

- **App developer**
- **Native UI**

## Connections

- App developer → Application model: defines app
- Application model → Window: provides window
- Window → View controls: hosts content
- View controls → Bindable properties: uses properties (evidence: `src/Controls/src/Core/View/View.cs`)
- Bindable properties → Property definitions: uses definitions (evidence: `src/Controls/src/Core/BindableObject.cs`)
- Visual states → Bindable properties: applies setters (evidence: `src/Controls/src/Core/VisualStateManager.cs`)
- Visual states → Window: references window (evidence: `src/Controls/src/Core/VisualStateManager.cs`)
- View controls → View contract: implements view (evidence: `src/Controls/src/Core/View/View.cs`)
- Grid layout → View contract: measures views (evidence: `src/Core/src/Layouts/GridLayoutManager.cs`)
- Grid layout → Graphics primitives: uses size types (evidence: `src/Core/src/Layouts/GridLayoutManager.cs`)
- View controls → Drag gestures: hosts gestures (evidence: `src/Controls/src/Core/DragAndDrop/DragGestureRecognizer.cs`)
- View controls → Platform handlers: adapts controls
- Platform handlers → Native UI: creates native UI
- Android platform → Drag gestures: handles drag events (evidence: `src/Controls/src/Core/Platform/Android/DragAndDropGestureHandler.cs`)
- Compatibility renderers → Native UI: renders controls
- App developer → Device essentials: uses device APIs
- App developer → Blazor WebView: hosts Blazor
- Blazor WebView → WebView managers: initializes WebView
- WebView managers → Static content reload: supports reload (evidence: `src/BlazorWebView/src/SharedSource/WebView2WebViewManager.cs`)
- Dispatcher → WebView managers: dispatches work (evidence: `src/BlazorWebView/src/SharedSource/WebView2WebViewManager.cs`)
