Back to Wpfui

Module Interfaces

docs/architecture/MODULE-INTERFACES.md

4.3.08.8 KB
Original Source

Module Interfaces

WPF UI v4.2.0 | Public and internal API surface per module

This document defines the public vs internal API surface for each module in the WPF UI solution. It serves as the contract specification for inter-module communication and consumer-facing APIs.


Module Dependency Graph

mermaid
graph TD
    subgraph "Public API Surface"
        Abstractions["<b>Wpf.Ui.Abstractions</b>
<i>Public: 6 types</i>
<i>Internal: none</i>"]
        Core["<b>Wpf.Ui</b>
<i>Public: 77+ controls, 6 services,
managers, converters, markup</i>
<i>Internal: Win32, Interop</i>"]
        DI["<b>Wpf.Ui.DependencyInjection</b>
<i>Public: 2 types</i>
<i>Internal: none</i>"]
        Tray["<b>Wpf.Ui.Tray</b>
<i>Public: 4 types</i>
<i>Internal: 7 types</i>"]
        Syntax["<b>Wpf.Ui.SyntaxHighlight</b>
<i>Public: 2 types</i>
<i>Internal: 2 types</i>"]
    end

    subgraph "Non-Distributable"
        Toast["<b>Wpf.Ui.ToastNotifications</b>
<i>Public: 1 type (STUB)</i>"]
        FlaUI["<b>Wpf.Ui.FlaUI</b>
<i>Public: 1 type</i>"]
        FontMapper["<b>Wpf.Ui.FontMapper</b>
<i>Build-time tool</i>"]
    end

    Core --> Abstractions
    DI --> Abstractions
    Tray --> Core
    Syntax --> Core

    style Abstractions fill:#e1f5ff,stroke:#0277bd
    style Core fill:#fff4e1,stroke:#f57f17
    style DI fill:#e8f5e9,stroke:#2e7d32
    style Tray fill:#e8f5e9,stroke:#2e7d32
    style Syntax fill:#e8f5e9,stroke:#2e7d32
    style Toast fill:#fff9c4,stroke:#f9a825
    style FlaUI fill:#f3e5f5,stroke:#6a1b9a
    style FontMapper fill:#f3e5f5,stroke:#6a1b9a

Module: Wpf.Ui.Abstractions

NuGet: WPF-UI.Abstractions TFMs: net10.0, net9.0, net8.0, net462, netstandard2.1, netstandard2.0 Dependencies: None (zero external dependencies)

Public Types

TypeKindDescription
INavigationViewPageProviderInterfaceResolves page instances by type for NavigationView
INavigableView<T>InterfaceAssociates a view with its ViewModel type
INavigationAwareInterfaceLifecycle callbacks for navigation (OnNavigatedTo/From)
NavigationAwareAbstract classBase implementation of INavigationAware
NavigationExceptionExceptionThrown when navigation operations fail
NavigationViewPageProviderExtensionsStatic classExtension methods for INavigationViewPageProvider

Internal Types

None. This module is entirely public by design -- it defines the contract surface.


Module: Wpf.Ui (Core)

NuGet: WPF-UI TFMs: net10.0-windows, net9.0-windows, net8.0-windows, net481, net472, net462 Dependencies: Wpf.Ui.Abstractions, Microsoft.Windows.CsWin32 (build-time), System.Memory

Public Namespaces

NamespaceContents
Wpf.UiUiApplication, service interfaces and implementations
Wpf.Ui.Controls77+ Fluent Design controls
Wpf.Ui.AppearanceApplicationThemeManager, ApplicationAccentColorManager, SystemThemeWatcher, WindowBackgroundManager
Wpf.Ui.Converters18 IValueConverter implementations
Wpf.Ui.MarkupControlsDictionary, ThemesDictionary, SymbolIconExtension, FontIconExtension, ImageIconExtension
Wpf.Ui.Extensions14 extension method classes
Wpf.Ui.InputIRelayCommand, IRelayCommand<T>, RelayCommand<T>

Public Service Interfaces

InterfaceImplementationWraps
INavigationServiceNavigationServiceINavigationView control
IContentDialogServiceContentDialogServiceContentDialog control
ISnackbarServiceSnackbarServiceSnackbar control
IThemeServiceThemeServiceApplicationThemeManager (static)
ITaskBarServiceTaskBarServiceCOM ITaskbarList4
INavigationWindowInterface for windows hosting NavigationView

Internal / Should-Be-Internal Namespaces

NamespaceStatusNotes
Wpf.Ui.InteropCurrently publicManaged Win32 wrappers (UnsafeNativeMethods, PInvoke). Recommended for internalization (see RECOMMENDATIONS.md)
Wpf.Ui.Win32Currently publicOS version utilities. Recommended for internalization

Note: Wpf.Ui.Interop and Wpf.Ui.Win32 expose raw P/Invoke declarations that are implementation details. Consumers should not depend on these namespaces. A future major version should mark them internal.


Module: Wpf.Ui.DependencyInjection

NuGet: WPF-UI.DependencyInjection TFMs: net10.0, net9.0, net8.0, net462, netstandard2.1, netstandard2.0 Dependencies: Wpf.Ui.Abstractions, Microsoft.Extensions.DependencyInjection.Abstractions 3.1.0

Public Types

TypeKindDescription
ServiceCollectionExtensionsStatic classAddNavigationViewPageProvider<T>() extension method for IServiceCollection
DependencyInjectionNavigationViewPageProviderClassINavigationViewPageProvider implementation that resolves pages via IServiceProvider

Internal Types

None.


Module: Wpf.Ui.Tray

NuGet: WPF-UI.Tray TFMs: net10.0-windows, net9.0-windows, net8.0-windows, net481, net472, net462 Dependencies: Wpf.Ui, System.Drawing.Common

Public Types

TypeKindDescription
INotifyIconServiceInterfaceService interface for tray icon management
NotifyIconServiceClassINotifyIconService implementation
NotifyIconControlWPF control for declarative tray icon in XAML
RoutedNotifyIconEventDelegateEvent delegate for tray icon interactions

Internal Types

TypeKindDescription
INotifyIconInterfaceInternal abstraction for tray icon operations
TrayHandlerClassShell32 Shell_NotifyIcon P/Invoke wrapper
TrayManagerClassTray icon lifecycle management
TrayDataStructNative tray icon data structure
HiconStructIcon handle wrapper
NotifyIconEventHandlerDelegateInternal event handler
InternalNotifyIconManagerClassTheme-aware tray icon management

Module: Wpf.Ui.SyntaxHighlight

NuGet: WPF-UI.SyntaxHighlight TFMs: net10.0-windows, net9.0-windows, net8.0-windows, net481, net472, net462 Dependencies: Wpf.Ui

Public Types

TypeKindDescription
CodeBlockControlWPF control for syntax-highlighted code display
SyntaxHighlightDictionaryMarkup ExtensionXAML resource dictionary for syntax highlighting styles

Internal Types

TypeKindDescription
HighlighterClassRegex-based syntax highlighting engine
SyntaxLanguageEnumSupported language identifiers

Module: Wpf.Ui.ToastNotifications

NuGet: WPF-UI.ToastNotifications TFMs: net10.0-windows, net9.0-windows, net8.0-windows, net481, net472, net462 Dependencies: None (standalone stub)

Public Types

TypeKindDescription
ToastClassSTUB — all methods throw NotImplementedException

Warning: This module is a placeholder with no implementation. See RECOMMENDATIONS.md — recommended to either implement or remove.


Module: Wpf.Ui.FlaUI

NuGet: WPF-UI.FlaUI TFMs: net10.0-windows, net9.0-windows, net8.0-windows, net481 Dependencies: FlaUI.Core

Public Types

TypeKindDescription
AutoSuggestBoxClassFlaUI automation element wrapper for Wpf.Ui.Controls.AutoSuggestBox

Module: Wpf.Ui.FontMapper

Type: Build-time console tool (not a distributable library) TFMs: net10.0 Dependencies: None

Public Types

None. This is a build tool that generates SymbolRegular and SymbolFilled enums from Fluent System Icons font JSON data. It is not referenced by other projects at runtime.


Cross-Module Interface Rules

  1. Abstractions are the only shared contract. Modules that need to communicate must do so through Wpf.Ui.Abstractions interfaces.
  2. Core library is the integration point. Only Wpf.Ui may depend on Win32 interop and WPF framework internals.
  3. Satellite packages depend downward only. Tray and SyntaxHighlight depend on Core; they never depend on each other.
  4. DI package depends on Abstractions only. Wpf.Ui.DependencyInjection must never take a dependency on Wpf.Ui to keep it lightweight.
  5. Internal namespaces are not API surface. Types in Wpf.Ui.Interop and Wpf.Ui.Win32 are implementation details even though they are currently public.