# madlongtom/shadcn.wpf architecture

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

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

## Overview

Shadcn.Wpf is a reusable .NET 9 WPF UI component library, accompanied by a presentation demo. In the demo workflow, a user selects a navigation item, the main view model asks the navigation service to display a page, and that page demonstrates library components. The library also provides theme management, feedback dialogs, and component families spanning forms, layout, navigation, and data display. Edges are limited to relationships documented in the README or shown by indexed excerpts; unsampled control wiring is not inferred.

Main entry points: [`Shadcn.Wpf.Presentation/ViewModels/MainWindowViewModel.cs`](https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf.Presentation/ViewModels/MainWindowViewModel.cs) (Main view model), [`Shadcn.Wpf.Presentation/Services/NavigationService.cs`](https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf.Presentation/Services/NavigationService.cs) (Navigation service), [`Shadcn.Wpf.Presentation/MainWindow.xaml.cs`](https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf.Presentation/MainWindow.xaml.cs) (Main window), [`Shadcn.Wpf.Presentation/ViewModels`](https://github.com/madlongtom/shadcn.wpf/tree/master/Shadcn.Wpf.Presentation/ViewModels) (Page view models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_demo["Demo application"]
  node_app["Application startup<br/>[App.xaml.cs]"]
  node_main["Main window<br/>[MainWindow.xaml.cs]"]
  node_mainvm["Main view model"]
  node_pages["Demo pages<br/>[Pages]"]
  node_pagevms["Page view models<br/>[ViewModels]"]
  node_basevm["Page view model base"]
end

subgraph group_navigation["Navigation"]
  node_navservice["Navigation service"]
  node_navinterface["Navigation contract"]
  node_navmenu["Navigation menu<br/>[ShadcnNavMenu.cs]"]
  node_navitem["Navigation item model<br/>[NavigationItem.cs]"]
end

subgraph group_components["UI components"]
  node_forms["Form controls<br/>[Controls]"]
  node_calendar["Calendar and date picker<br/>[ShadcnCalendar.cs]"]
  node_layout["Layout controls"]
  node_window["Custom window<br/>[ShadcnWindow.cs]"]
  node_feedback["Feedback controls"]
end

subgraph group_services["Theme and feedback"]
  node_theme["Theme manager<br/>[ThemeManager.cs]"]
  node_messages["Message service<br/>[MessageService.cs]"]
  node_messagecontract["Message contract<br/>[IMessageService.cs]"]
end

node_user(("Demo user"))
node_systemtheme(("Windows theme settings"))

node_user -->|"uses"| node_main
node_app -->|"applies theme"| node_theme
node_main -->|"uses"| node_mainvm
node_main -->|"initializes"| node_navservice
node_mainvm -->|"navigates"| node_navservice
node_navservice -->|"routes to"| node_pages
node_mainvm -->|"creates and selects"| node_navitem
node_navmenu -->|"uses model"| node_navitem
node_pages -->|"binds view model"| node_pagevms
node_pagevms -->|"inherits"| node_basevm
node_pagevms -->|"shows feedback"| node_messages
node_calendar -->|"supports date input"| node_forms
node_messages -->|"displays dialogs"| node_feedback
node_messages -->|"implements"| node_messagecontract
node_mainvm -->|"changes theme"| node_theme
node_theme -->|"reads preferences"| node_systemtheme
node_navservice -->|"implements"| node_navinterface

click node_app "https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf.Presentation/App.xaml.cs"
click node_main "https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf.Presentation/MainWindow.xaml.cs"
click node_mainvm "https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf.Presentation/ViewModels/MainWindowViewModel.cs"
click node_pages "https://github.com/madlongtom/shadcn.wpf/tree/master/Shadcn.Wpf.Presentation/Pages"
click node_pagevms "https://github.com/madlongtom/shadcn.wpf/tree/master/Shadcn.Wpf.Presentation/ViewModels"
click node_basevm "https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf.Presentation/ViewModels/BasePageViewModel.cs"
click node_navservice "https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf.Presentation/Services/NavigationService.cs"
click node_navinterface "https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf.Presentation/Services/INavigationService.cs"
click node_navmenu "https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf/Controls/ShadcnNavMenu.cs"
click node_navitem "https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf/Models/NavigationItem.cs"
click node_forms "https://github.com/madlongtom/shadcn.wpf/tree/master/Shadcn.Wpf/Controls"
click node_calendar "https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf/Controls/ShadcnCalendar.cs"
click node_layout "https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf/Controls/ShadcnTabControl.cs"
click node_window "https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf/Controls/ShadcnWindow.cs"
click node_feedback "https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf/Controls/ShadcnMessageDialog.xaml.cs"
click node_theme "https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf/Themes/ThemeManager.cs"
click node_messages "https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf/Services/MessageService.cs"
click node_messagecontract "https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf/Services/IMessageService.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,node_main,node_mainvm,node_pages,node_pagevms,node_basevm,node_user toneBlue
class node_navservice,node_navinterface,node_navmenu,node_navitem toneAmber
class node_forms,node_calendar,node_layout,node_window,node_feedback toneMint
class node_theme,node_messages,node_messagecontract toneRose
class node_systemtheme toneIndigo
```

## Components

### Demo application

- [Application startup](https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf.Presentation/App.xaml.cs): `Shadcn.Wpf.Presentation/App.xaml.cs`
- [Main window](https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf.Presentation/MainWindow.xaml.cs): `Shadcn.Wpf.Presentation/MainWindow.xaml.cs`
- [Main view model](https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf.Presentation/ViewModels/MainWindowViewModel.cs): `Shadcn.Wpf.Presentation/ViewModels/MainWindowViewModel.cs`
- [Demo pages](https://github.com/madlongtom/shadcn.wpf/tree/master/Shadcn.Wpf.Presentation/Pages): `Shadcn.Wpf.Presentation/Pages`
- [Page view models](https://github.com/madlongtom/shadcn.wpf/tree/master/Shadcn.Wpf.Presentation/ViewModels): `Shadcn.Wpf.Presentation/ViewModels`
- [Page view model base](https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf.Presentation/ViewModels/BasePageViewModel.cs): `Shadcn.Wpf.Presentation/ViewModels/BasePageViewModel.cs`

### Navigation

- [Navigation service](https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf.Presentation/Services/NavigationService.cs): `Shadcn.Wpf.Presentation/Services/NavigationService.cs`
- [Navigation contract](https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf.Presentation/Services/INavigationService.cs): `Shadcn.Wpf.Presentation/Services/INavigationService.cs`
- [Navigation menu](https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf/Controls/ShadcnNavMenu.cs): `Shadcn.Wpf/Controls/ShadcnNavMenu.cs`
- [Navigation item model](https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf/Models/NavigationItem.cs): `Shadcn.Wpf/Models/NavigationItem.cs`

### UI components

- [Form controls](https://github.com/madlongtom/shadcn.wpf/tree/master/Shadcn.Wpf/Controls): `Shadcn.Wpf/Controls`
- [Calendar and date picker](https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf/Controls/ShadcnCalendar.cs): `Shadcn.Wpf/Controls/ShadcnCalendar.cs`
- [Layout controls](https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf/Controls/ShadcnTabControl.cs): `Shadcn.Wpf/Controls/ShadcnTabControl.cs`
- [Custom window](https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf/Controls/ShadcnWindow.cs): `Shadcn.Wpf/Controls/ShadcnWindow.cs`
- [Feedback controls](https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf/Controls/ShadcnMessageDialog.xaml.cs): `Shadcn.Wpf/Controls/ShadcnMessageDialog.xaml.cs`

### Theme and feedback

- [Theme manager](https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf/Themes/ThemeManager.cs): `Shadcn.Wpf/Themes/ThemeManager.cs`
- [Message service](https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf/Services/MessageService.cs): `Shadcn.Wpf/Services/MessageService.cs`
- [Message contract](https://github.com/madlongtom/shadcn.wpf/blob/master/Shadcn.Wpf/Services/IMessageService.cs): `Shadcn.Wpf/Services/IMessageService.cs`

### Other components

- **Demo user**
- **Windows theme settings**

## Connections

- Demo user → Main window: uses (evidence: `README.md`)
- Application startup → Theme manager: applies theme (evidence: `Shadcn.Wpf.Presentation/App.xaml.cs`)
- Main window → Main view model: uses (evidence: `Shadcn.Wpf.Presentation/MainWindow.xaml.cs`)
- Main window → Navigation service: initializes (evidence: `Shadcn.Wpf.Presentation/MainWindow.xaml.cs`)
- Main view model → Navigation service: navigates (evidence: `Shadcn.Wpf.Presentation/ViewModels/MainWindowViewModel.cs`)
- Navigation service → Demo pages: routes to (evidence: `Shadcn.Wpf.Presentation/Services/NavigationService.cs`)
- Main view model → Navigation item model: creates and selects (evidence: `Shadcn.Wpf.Presentation/ViewModels/MainWindowViewModel.cs`)
- Navigation menu → Navigation item model: uses model (evidence: `Shadcn.Wpf/Controls/ShadcnNavMenu.cs`)
- Demo pages → Page view models: binds view model (evidence: `Shadcn.Wpf.Presentation/Pages/ButtonsPage.xaml.cs`)
- Page view models → Page view model base: inherits (evidence: `Shadcn.Wpf.Presentation/ViewModels/DatePickerDemoPageViewModel.cs`)
- Page view models → Message service: shows feedback (evidence: `Shadcn.Wpf.Presentation/ViewModels/DatePickerDemoPageViewModel.cs`)
- Calendar and date picker → Form controls: supports date input (evidence: `Shadcn.Wpf/Controls/ShadcnDatePicker.cs`)
- Message service → Feedback controls: displays dialogs (evidence: `Shadcn.Wpf/Services/MessageService.cs`)
- Message service → Message contract: implements (evidence: `Shadcn.Wpf/Services/MessageService.cs`)
- Main view model → Theme manager: changes theme (evidence: `Shadcn.Wpf.Presentation/ViewModels/MainWindowViewModel.cs`)
- Theme manager → Windows theme settings: reads preferences (evidence: `Shadcn.Wpf/Themes/ThemeManager.cs`)
- Navigation service → Navigation contract: implements (evidence: `Shadcn.Wpf.Presentation/Services/NavigationService.cs`)
