# communitytoolkit/mvvm-samples architecture

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

- Interactive diagram: https://gitdiagram.com/communitytoolkit/mvvm-samples
- Repository: https://github.com/communitytoolkit/mvvm-samples

## Overview

This checkout is presented as the MVVM Toolkit sample app, not the toolkit’s library implementation: the README identifies the package separately, and the tree contains sample projects but no package source. The user-facing flow is to open a sample app and explore pages demonstrating MVVM concepts; the shared sample core supplies viewmodels and service contracts, with platform projects providing UI and some service implementations. The README documents the samples’ purpose, but no source excerpts were provided, so internal call relationships are omitted rather than inferred.

Main entry points: [`samples/MvvmSampleMAUI`](https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSampleMAUI) (MAUI sample app), [`samples/MvvmSampleUwp`](https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSampleUwp) (UWP sample app), [`samples/MvvmSampleXF/MvvmSampleXF`](https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSampleXF/MvvmSampleXF) (Xamarin sample app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Sample applications"]
  node_maui["MAUI sample app"]
  node_uwp["UWP sample app"]
  node_xamarin["Xamarin sample app"]
end

subgraph group_core["Shared sample core"]
  node_coremodels["Sample models<br/>[Models]"]
  node_coreviewmodels["Sample viewmodels<br/>[ViewModels]"]
  node_contracts["Service contracts<br/>[Services]"]
end

subgraph group_examples["MVVM examples"]
  node_commands["Command examples<br/>[ViewModels]"]
  node_observable["Observable examples<br/>[ViewModels]"]
  node_messenger["Messenger examples<br/>[ViewModels]"]
  node_validation["Validation examples<br/>[Widgets]"]
  node_ioc["IoC example"]
  node_reddit["Reddit example<br/>[IRedditService.cs]"]
end

subgraph group_services["Sample services"]
  node_settings["Settings service<br/>[SettingsService.cs]"]
  node_files["File service<br/>[FileService.cs]"]
  node_contacts["Contacts contract"]
  node_dialogs["Dialog contract<br/>[IDialogService.cs]"]
end

node_developer(("App developer"))
node_toolkit["MVVM Toolkit"]

node_developer -->|"explores samples"| node_maui
node_developer -->|"explores samples"| node_uwp
node_developer -->|"explores samples"| node_xamarin
node_maui -->|"demonstrates use"| node_toolkit
node_uwp -->|"demonstrates use"| node_toolkit
node_xamarin -->|"demonstrates use"| node_toolkit

click node_maui "https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSampleMAUI"
click node_uwp "https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSampleUwp"
click node_xamarin "https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSampleXF/MvvmSampleXF"
click node_coremodels "https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSample.Core/Models"
click node_coreviewmodels "https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSample.Core/ViewModels"
click node_contracts "https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSample.Core/Services"
click node_commands "https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSample.Core/ViewModels"
click node_observable "https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSample.Core/ViewModels"
click node_messenger "https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSample.Core/ViewModels"
click node_validation "https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSample.Core/ViewModels/Widgets"
click node_ioc "https://github.com/communitytoolkit/mvvm-samples/blob/master/samples/MvvmSample.Core/ViewModels/IocPageViewModel.cs"
click node_reddit "https://github.com/communitytoolkit/mvvm-samples/blob/master/samples/MvvmSample.Core/Services/IRedditService.cs"
click node_settings "https://github.com/communitytoolkit/mvvm-samples/blob/master/samples/MvvmSampleMAUI/Services/SettingsService.cs"
click node_files "https://github.com/communitytoolkit/mvvm-samples/blob/master/samples/MvvmSampleMAUI/Services/FileService.cs"
click node_contacts "https://github.com/communitytoolkit/mvvm-samples/blob/master/samples/MvvmSample.Core/Services/IContactsService.cs"
click node_dialogs "https://github.com/communitytoolkit/mvvm-samples/blob/master/samples/MvvmSample.Core/Services/IDialogService.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_maui,node_uwp,node_xamarin toneBlue
class node_coremodels,node_coreviewmodels,node_contracts toneAmber
class node_commands,node_observable,node_messenger,node_validation,node_ioc,node_reddit toneMint
class node_settings,node_files,node_contacts,node_dialogs toneRose
class node_developer,node_toolkit toneIndigo
```

## Components

### Sample applications

- [MAUI sample app](https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSampleMAUI): `samples/MvvmSampleMAUI`
- [UWP sample app](https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSampleUwp): `samples/MvvmSampleUwp`
- [Xamarin sample app](https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSampleXF/MvvmSampleXF): `samples/MvvmSampleXF/MvvmSampleXF`

### Shared sample core

- [Sample models](https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSample.Core/Models): `samples/MvvmSample.Core/Models`
- [Sample viewmodels](https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSample.Core/ViewModels): `samples/MvvmSample.Core/ViewModels`
- [Service contracts](https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSample.Core/Services): `samples/MvvmSample.Core/Services`

### MVVM examples

- [Command examples](https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSample.Core/ViewModels): `samples/MvvmSample.Core/ViewModels`
- [Observable examples](https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSample.Core/ViewModels): `samples/MvvmSample.Core/ViewModels`
- [Messenger examples](https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSample.Core/ViewModels): `samples/MvvmSample.Core/ViewModels`
- [Validation examples](https://github.com/communitytoolkit/mvvm-samples/tree/master/samples/MvvmSample.Core/ViewModels/Widgets): `samples/MvvmSample.Core/ViewModels/Widgets`
- [IoC example](https://github.com/communitytoolkit/mvvm-samples/blob/master/samples/MvvmSample.Core/ViewModels/IocPageViewModel.cs): `samples/MvvmSample.Core/ViewModels/IocPageViewModel.cs`
- [Reddit example](https://github.com/communitytoolkit/mvvm-samples/blob/master/samples/MvvmSample.Core/Services/IRedditService.cs): `samples/MvvmSample.Core/Services/IRedditService.cs`

### Sample services

- [Settings service](https://github.com/communitytoolkit/mvvm-samples/blob/master/samples/MvvmSampleMAUI/Services/SettingsService.cs): `samples/MvvmSampleMAUI/Services/SettingsService.cs`
- [File service](https://github.com/communitytoolkit/mvvm-samples/blob/master/samples/MvvmSampleMAUI/Services/FileService.cs): `samples/MvvmSampleMAUI/Services/FileService.cs`
- [Contacts contract](https://github.com/communitytoolkit/mvvm-samples/blob/master/samples/MvvmSample.Core/Services/IContactsService.cs): `samples/MvvmSample.Core/Services/IContactsService.cs`
- [Dialog contract](https://github.com/communitytoolkit/mvvm-samples/blob/master/samples/MvvmSample.Core/Services/IDialogService.cs): `samples/MvvmSample.Core/Services/IDialogService.cs`

### Other components

- **App developer**
- **MVVM Toolkit**

## Connections

- App developer → MAUI sample app: explores samples (evidence: `README.md`)
- App developer → UWP sample app: explores samples (evidence: `README.md`)
- App developer → Xamarin sample app: explores samples (evidence: `README.md`)
- MAUI sample app → MVVM Toolkit: demonstrates use (evidence: `README.md`)
- UWP sample app → MVVM Toolkit: demonstrates use (evidence: `README.md`)
- Xamarin sample app → MVVM Toolkit: demonstrates use (evidence: `README.md`)
