# yiszza/mdc-maui architecture

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

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

## Overview

#### Purpose and Entry Points
Material.Components.Maui is a reusable .NET MAUI library implementing Material-style UI controls, distributed as `Material.Components.Maui`. Its project entry is `src/Material.Components.Maui/Material.Components.Maui.csproj`; the solution is `src/Material.Components.Maui.sln`. A multi-platform MAUI sample consumes the library through `sample/MauiProgram.cs`, with application startup in `sample/App.xaml` and initial navigation in `sample/Pages/MainPage.xaml`.

#### Library Registration and Consumer Boundary
Consumers configure the library through MAUI builder extensions, then use controls from XAML or C#. `src/Material.Components.Maui/Extensions/MauiAppBuilderExtensions.cs` is the integration boundary for registration, while `src/Material.Components.Maui/GlobalUsings.cs` establishes library-wide dependencies. Fluent APIs under `src/Material.Components.Maui/FluentExtensions/` expose shared control capabilities without coupling consumers to implementation details.

#### Control Model and Shared Contracts
The core product is a set of MAUI visual controls organized by feature under `src/Material.Components.Maui/Components/`. Components share composable element contracts—content, item collections, styling, shapes, state layers, ripple, icons, and editing—from `src/Material.Components.Maui/Interfaces/IElement.cs`, `src/Material.Components.Maui/Interfaces/IStyleElement.cs`, and `src/Material.Components.Maui/Interfaces/IEditableElement.cs`. This separates public control semantics from rendering and platform adaptation.

#### Rendering and Interaction Layer
Most controls pair a public control with a drawable responsible for Material visuals and state-driven rendering: `src/Material.Components.Maui/Components/Button/Button.cs`, `src/Material.Components.Maui/Components/Button/ButtonDrawable.cs`, and `src/Material.Components.Maui/Components/TouchGraphicsView.cs`. The same pattern supports input, selection, navigation, and feedback controls, including `src/Material.Components.Maui/Components/TextField/TextField.cs` and `src/Material.Components.Maui/Components/NavigationDrawer/NavigationDrawer.cs`.

#### Text Editing and Native Handler Boundary
Text input is the most explicit native integration path. `src/Material.Components.Maui/Handlers/TextField/TextFieldHandler.cs` maps the cross-platform `TextField` to native views, with per-platform implementations in `src/Material.Components.Maui/Handlers/TextField/TextFieldHandler.android.cs`, `src/Material.Components.Maui/Handlers/TextField/TextFieldHandler.windows.cs`, and platform text-view adapters under `src/Material.Components.Maui/Components/TextField/`. Editing state and selection event types flow through primitives such as `src/Material.Components.Maui/Primitives/TextRange.cs`.

#### Platform-Specific Presentation
Popup and context-menu behavior are split into shared APIs plus Android, Windows, and Apple-platform implementations: `src/Material.Components.Maui/Components/Popup/Popup.cs`, `src/Material.Components.Maui/Components/Popup/Popup.android.cs`, and `src/Material.Components.Maui/Components/ContextMenu/ContextMenu.windows.cs`. This is the principal boundary where MAUI abstractions yield to native platform presentation APIs. Supported app targets represented by the sample are Android, iOS, Mac Catalyst, Windows, and Tizen.

#### Design System Resources
Material design tokens and XAML resource dictionaries provide consistent colors, elevation, shapes, state opacity, and per-control defaults. Core tokens reside in `src/Material.Components.Maui/Tokens/MaterialColors.cs`, `src/Material.Components.Maui/Tokens/Shape.cs`, and `src/Material.Components.Maui/Tokens/Elevation.cs`; aggregate styling is rooted in `src/Material.Components.Maui/Styles/MaterialStyles.xaml`. Controls consume these resources while allowing consumer-level overrides.

#### Sample and Documentation
The sample is a verification and usage host rather than a backend application: `sample/SampleApp.csproj`, `sample/Pages/01.OverviewPage.xaml`, and `sample/Pages/SettingsPage.xaml`. Documentation is static Markdown organized per control in `docs/`, with the documentation site referenced externally in the README. No server, database, authentication provider, or external runtime service is present; the material infrastructure is .NET MAUI plus native platform UI APIs.

Main entry points: [`src/Material.Components.Maui/Styles/MaterialStyles.xaml`](https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Styles/MaterialStyles.xaml) (Material styles), [`sample/SampleApp.csproj`](https://github.com/yiszza/mdc-maui/blob/develop/sample/SampleApp.csproj) (Sample application), [`src/Material.Components.Maui/Components/Button/Button.cs`](https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Components/Button/Button.cs) (Button), [`src/Material.Components.Maui/Components/TextField/TextField.cs`](https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Components/TextField/TextField.cs) (Text field)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_library["MAUI Library"]
  node_package["Material.Components.Maui<br/>MAUI library"]
  node_registration["Builder registration<br/>extension API"]
  node_global_usings["Global dependencies<br/>global usings<br/>[GlobalUsings.cs]"]
  node_fluent["Fluent control APIs<br/>extensions"]
  node_components["Material controls<br/>control suite"]
  node_element_contract["Element contracts<br/>public contract<br/>[IElement.cs]"]
  node_style_contract["Style contract<br/>public contract<br/>[IStyleElement.cs]"]
  node_editable_contract["Editable contract<br/>public contract"]
end

subgraph group_rendering["Rendering &amp; Native"]
  node_button["Button<br/>public control<br/>[Button.cs]"]
  node_button_drawable["Button drawable<br/>renderer<br/>[ButtonDrawable.cs]"]
  node_touch_view["Touch graphics view<br/>interaction surface"]
  node_text_field["Text field<br/>public control<br/>[TextField.cs]"]
  node_text_handler{{"Text field handler<br/>native handler"}}
  node_text_range["Text range<br/>editing primitive<br/>[TextRange.cs]"]
  node_popup["Popup API<br/>platform presentation<br/>[Popup.cs]"]
end

subgraph group_design["Design System"]
  node_material_styles["Material styles<br/>XAML resources"]
  node_colors["Material colors<br/>design token<br/>[MaterialColors.cs]"]
  node_shape["Shape tokens<br/>design token<br/>[Shape.cs]"]
  node_elevation["Elevation tokens<br/>design token<br/>[Elevation.cs]"]
end

subgraph group_sample["Sample &amp; Docs"]
  node_sample_app["Sample application<br/>MAUI consumer<br/>[SampleApp.csproj]"]
  node_sample_bootstrap["Sample bootstrap<br/>app startup<br/>[MauiProgram.cs]"]
  node_main_page["Main navigation<br/>XAML page<br/>[MainPage.xaml]"]
  node_overview["Overview page<br/>XAML page"]
  node_docs["Control documentation<br/>Markdown docs"]
end

node_package -->|"exports"| node_registration
node_package -->|"packages"| node_components
node_global_usings -.->|"shared dependencies"| node_components
node_registration -->|"registers"| node_components
node_fluent -->|"extends"| node_components
node_components -->|"implements"| node_element_contract
node_components -->|"implements"| node_style_contract
node_components -->|"implements"| node_editable_contract
node_components -->|"includes"| node_button
node_button -->|"renders with"| node_button_drawable
node_button -->|"handles interaction via"| node_touch_view
node_components -->|"includes"| node_text_field
node_text_field -->|"maps through"| node_text_handler
node_text_field -->|"uses editing state"| node_text_range
node_components -->|"includes"| node_popup
node_material_styles -->|"uses"| node_colors
node_material_styles -->|"uses"| node_shape
node_material_styles -->|"uses"| node_elevation
node_components -->|"consumes"| node_material_styles
node_sample_app -->|"consumes"| node_package
node_sample_bootstrap -->|"configures"| node_registration
node_sample_app -->|"starts"| node_sample_bootstrap
node_main_page -->|"navigates to"| node_overview
node_sample_app -->|"initial UI"| node_main_page
node_docs -.->|"documents"| node_components

click node_package "https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Material.Components.Maui.csproj"
click node_registration "https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Extensions/MauiAppBuilderExtensions.cs"
click node_global_usings "https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/GlobalUsings.cs"
click node_element_contract "https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Interfaces/IElement.cs"
click node_style_contract "https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Interfaces/IStyleElement.cs"
click node_editable_contract "https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Interfaces/IEditableElement.cs"
click node_button "https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Components/Button/Button.cs"
click node_button_drawable "https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Components/Button/ButtonDrawable.cs"
click node_touch_view "https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Components/TouchGraphicsView.cs"
click node_text_field "https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Components/TextField/TextField.cs"
click node_text_handler "https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Handlers/TextField/TextFieldHandler.cs"
click node_text_range "https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Primitives/TextRange.cs"
click node_popup "https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Components/Popup/Popup.cs"
click node_material_styles "https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Styles/MaterialStyles.xaml"
click node_colors "https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Tokens/MaterialColors.cs"
click node_shape "https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Tokens/Shape.cs"
click node_elevation "https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Tokens/Elevation.cs"
click node_sample_app "https://github.com/yiszza/mdc-maui/blob/develop/sample/SampleApp.csproj"
click node_sample_bootstrap "https://github.com/yiszza/mdc-maui/blob/develop/sample/MauiProgram.cs"
click node_main_page "https://github.com/yiszza/mdc-maui/blob/develop/sample/Pages/MainPage.xaml"
click node_overview "https://github.com/yiszza/mdc-maui/blob/develop/sample/Pages/01.OverviewPage.xaml"

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_package,node_registration,node_global_usings,node_fluent,node_components,node_element_contract,node_style_contract,node_editable_contract toneBlue
class node_button,node_button_drawable,node_touch_view,node_text_field,node_text_handler,node_text_range,node_popup toneAmber
class node_material_styles,node_colors,node_shape,node_elevation toneMint
class node_sample_app,node_sample_bootstrap,node_main_page,node_overview,node_docs toneRose
```

## Components

### MAUI Library

Reusable Material control package.

- [Material.Components.Maui](https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Material.Components.Maui.csproj): MAUI library · `src/Material.Components.Maui/Material.Components.Maui.csproj`
- [Builder registration](https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Extensions/MauiAppBuilderExtensions.cs): extension API · Consumer integration boundary. · `src/Material.Components.Maui/Extensions/MauiAppBuilderExtensions.cs`
- [Global dependencies](https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/GlobalUsings.cs): global usings · `src/Material.Components.Maui/GlobalUsings.cs`
- **Fluent control APIs**: extensions
- **Material controls**: control suite · Public controls organized by feature.
- [Element contracts](https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Interfaces/IElement.cs): public contract · Composable content, item, state, and visual semantics. · `src/Material.Components.Maui/Interfaces/IElement.cs`
- [Style contract](https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Interfaces/IStyleElement.cs): public contract · `src/Material.Components.Maui/Interfaces/IStyleElement.cs`
- [Editable contract](https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Interfaces/IEditableElement.cs): public contract · `src/Material.Components.Maui/Interfaces/IEditableElement.cs`

### Rendering & Native

Drawing, handlers, and platform presentation.

- [Button](https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Components/Button/Button.cs): public control · `src/Material.Components.Maui/Components/Button/Button.cs`
- [Button drawable](https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Components/Button/ButtonDrawable.cs): renderer · Draws Material visuals from control state. · `src/Material.Components.Maui/Components/Button/ButtonDrawable.cs`
- [Touch graphics view](https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Components/TouchGraphicsView.cs): interaction surface · `src/Material.Components.Maui/Components/TouchGraphicsView.cs`
- [Text field](https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Components/TextField/TextField.cs): public control · `src/Material.Components.Maui/Components/TextField/TextField.cs`
- [Text field handler](https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Handlers/TextField/TextFieldHandler.cs): native handler · Maps cross-platform text input to native views. · `src/Material.Components.Maui/Handlers/TextField/TextFieldHandler.cs`
- [Text range](https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Primitives/TextRange.cs): editing primitive · `src/Material.Components.Maui/Primitives/TextRange.cs`
- [Popup API](https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Components/Popup/Popup.cs): platform presentation · Shared popup API with native implementations. · `src/Material.Components.Maui/Components/Popup/Popup.cs`

### Design System

Shared Material tokens and styles.

- [Material styles](https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Styles/MaterialStyles.xaml): XAML resources · Aggregates per-control defaults. · `src/Material.Components.Maui/Styles/MaterialStyles.xaml`
- [Material colors](https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Tokens/MaterialColors.cs): design token · `src/Material.Components.Maui/Tokens/MaterialColors.cs`
- [Shape tokens](https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Tokens/Shape.cs): design token · `src/Material.Components.Maui/Tokens/Shape.cs`
- [Elevation tokens](https://github.com/yiszza/mdc-maui/blob/develop/src/Material.Components.Maui/Tokens/Elevation.cs): design token · `src/Material.Components.Maui/Tokens/Elevation.cs`

### Sample & Docs

Consumer usage and documentation.

- [Sample application](https://github.com/yiszza/mdc-maui/blob/develop/sample/SampleApp.csproj): MAUI consumer · Multi-platform verification and usage host. · `sample/SampleApp.csproj`
- [Sample bootstrap](https://github.com/yiszza/mdc-maui/blob/develop/sample/MauiProgram.cs): app startup · `sample/MauiProgram.cs`
- [Main navigation](https://github.com/yiszza/mdc-maui/blob/develop/sample/Pages/MainPage.xaml): XAML page · Initial sample navigation. · `sample/Pages/MainPage.xaml`
- [Overview page](https://github.com/yiszza/mdc-maui/blob/develop/sample/Pages/01.OverviewPage.xaml): XAML page · `sample/Pages/01.OverviewPage.xaml`
- **Control documentation**: Markdown docs

## Connections

- Material.Components.Maui → Builder registration: exports
- Material.Components.Maui → Material controls: packages
- Global dependencies → Material controls: shared dependencies
- Builder registration → Material controls: registers
- Fluent control APIs → Material controls: extends
- Material controls → Element contracts: implements
- Material controls → Style contract: implements
- Material controls → Editable contract: implements
- Material controls → Button: includes
- Button → Button drawable: renders with
- Button → Touch graphics view: handles interaction via
- Material controls → Text field: includes
- Text field → Text field handler: maps through
- Text field → Text range: uses editing state
- Material controls → Popup API: includes
- Material styles → Material colors: uses
- Material styles → Shape tokens: uses
- Material styles → Elevation tokens: uses
- Material controls → Material styles: consumes
- Sample application → Material.Components.Maui: consumes
- Sample bootstrap → Builder registration: configures
- Sample application → Sample bootstrap: starts
- Main navigation → Overview page: navigates to
- Sample application → Main navigation: initial UI
- Control documentation → Material controls: documents
