Mosaic UI for WPF

July 31, 2026 · View on GitHub

Mosaic UI for WPF is a control library that seeks to provide compartmentalized controls that if needed could be easily extracted from this project and included in your own.

Almost every WPF UI kit contains a way to theme that's custom and unique to their framework, it makes mixing and matching controls sometimes cumbersome. This project is trying to provide enough themeing options that you could use it by itself but not tether all of the controls to it so you could include it, or parts of it in other projects that use other UI libraries. I'll also be providing basic examples of how to use each control so you've got a copy/paste reference to start from and a working demo app to quickly browse and try out controls.

WPF is a great, mature technology that will be with us for a long time now that's part of .NET Core. WPF's current and future longevity are one of its strengths. If you're writing a hobby project you want to be around in 10 years, WPF is a great choice. Credit to the dotnet developer team for bringing it the modern .NET stack.

If you find this project interesting or useful, please give it a star.

Note: Expect frequent updates to the styling system during the early stages of this project. I’m currently exploring various theming patterns through a process of experimentation. I've concluded that customizing the default control templates for native WPF controls is necessary; these will be provided in a separate ResourceDictionary. Previously, I overrode SystemColors, but this approach proved too invasive—particularly for applications aiming to coexist with other UI frameworks without conflict. Also, there are many stock controls that use static resources or hard coded colors so SystemColors gets you some of the way there, but not all of the way

A final note, if you have a useful reusable (mostly) compartmentalized control you want to share and be creditted for, feel free to put in a pull request and I'll look at it.

Getting Started

Install the NuGet Package

Install the package from NuGet using the .NET CLI:

dotnet add package MosaicUIWpf

Or search for MosaicUIWpf in the Visual Studio NuGet Package Manager.

Set Up Your Application

1. Update App.xaml to use MosaicApp and merge ThemeManager into your application resources:

<wpf:MosaicApp
    x:Class="YourApp.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mosaic="http://schemas.apexgate.net/wpf/mosaic-ui"
    xmlns:vm="clr-namespace:YourApp.Common"
    xmlns:wpf="clr-namespace:Mosaic.UI.Wpf;assembly=Mosaic.UI.Wpf"
    x:TypeArguments="vm:AppSettings, vm:AppViewModel"
    StartupUri="MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <mosaic:ThemeManager
                    Native="True"
                    SystemColors="True"
                    Theme="Dark" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</wpf:MosaicApp>

Set Theme to "Light", "Dark", or "HighContrast". Set Native="True" to restyle built-in WPF controls. Set SystemColors="True" to integrate with the OS accent color.

2. Update MainWindow.xaml to apply the window chrome behavior and Mosaic theme brushes:

<Window
    x:Class="YourApp.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mosaic="clr-namespace:Mosaic.UI.Wpf.Controls;assembly=Mosaic.UI.Wpf"
    xmlns:theme="http://schemas.apexgate.net/wpf/mosaic-ui"
    theme:WindowChromeBehavior.CaptionHeight="0"
    theme:WindowChromeBehavior.CornerRadius="10"
    theme:WindowChromeBehavior.IsEnabled="True"
    theme:WindowChromeBehavior.ResizeBorderThickness="5"
    Background="{DynamicResource {x:Static theme:MosaicTheme.WindowBackgroundBrush}}"
    Foreground="{DynamicResource {x:Static theme:MosaicTheme.WindowForegroundBrush}}">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="35" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <mosaic:WindowTitleBar Grid.Row="0" IconSource="/Assets/icon.png" />

        <!-- Your content here -->
    </Grid>
</Window>

3. Use controls anywhere in your XAML with the mosaic namespace (http://schemas.apexgate.net/wpf/mosaic-ui):

xmlns:mosaic="http://schemas.apexgate.net/wpf/mosaic-ui"

For a complete wiring example, see MosaicTemplateApp in the repository.

Dark Theme

Dark Theme

VT52 Terminal with Green Phosphor Effect

Light Theme

Light Theme

Blue Theme (Text Editor Demo Project)

Blue Theme

Architecture Blueprint

See docs/ARCHITECTURE_BLUEPRINT.md for the control-library architecture, theming model, interoperability rules, accessibility baseline, and DX guidelines.

Solution Projects

FeatureDescription
Mosaic.UI.WpfThe control library.
Mosaic.UI.Wpf.AvalonDockMosaic-themed AvalonDock integration for IDE-style document and tool-window docking. See the AvalonDock README.
MosaicWpfDemoThe main demo project that houses examples and snippets of each control in the library as well as usage of other types and behaviors.

Included Controls

The following table lists the controls found in src/Mosaic.UI.Wpf/Controls and their class descriptions (from XML comments).

ControlDescription
AccentButtonRepresents a themed button that changes its accent color based on AccentButtonType (ThemeAccent, Gray, FluentGreen, FluentRed, or Default).
AdaptiveImageImage that adapts its colors to match app/OS theme. Intended purpose is to be used for icons to be able to adapt.
AsteriskTextBlockA text block that displays asterisks for each character in its text property.
AudioPlayerAn audio player control with a familiar transport layout: a centered Previous / Play-Stop / Next button row above a full-width seek slider flanked by current playback time and total track length. Backed by MediaPlayer and manages an internal playlist.
AudioPlayerSpectrumAnalyzerA real-time spectrum analyzer designed to pair with the AudioPlayer control. Renders frequency bands on the horizontal axis and signal strength on the vertical axis, with optional peak-hold indicators and amplitude-driven color intensity.
AutoCompleteBoxRepresents an editable selection control that filters suggestions while the user types and commits a selected item.
AvatarRepresents a customizable avatar control that displays content with support for corner radius and template selection.
BadgeA badge component.
BindablePasswordBoxRepresents a password input control that supports data binding for the password value.
ChatThreadA chat thread control which shows sent and received messages in a single thread format.
CheckBoxListA ListBox variant that defaults to multiple selection and displays a checkbox beside each item.
ClipBorderBorder which allows clipping to its border. Useful especially when you need to clip to round corners.
ColorPickerA color picker UserControl that allows users to select colors from presets or enter hex values.
ContentPanelA content panel with optional header and footer areas, configurable separators, corner radius, and header/footer brushes.
CopyTextBoxA text box with an attached copy button that places its text onto the clipboard, with optional toast notification of success or failure.
DatePickerRepresents a date picker control that displays a popup calendar for date selection.
DateSpinnerA date picker that dials in a date with three coordinated month, day and year wheels instead of a calendar grid, in the style of the WinUI 3 date picker. Culture-aware field order, nullable selection, range limits with boundary filtering, and explicit or immediate commit.
DocumentContainerDisplays an observable collection of closable, reorderable documents as tabs.
EditableTextBlockRepresents a control that displays text in a non-editable mode and allows users to switch to an editable mode to modify the text. The control supports double-click editing, text trimming, and customizable appearance.
EnumComboBoxA ComboBox that populates itself from an enum type, displaying friendly names (EnumDisplayName → Description → member name) while exposing the actual enum value through SelectedValue.
ExecutionControlA transport style control that exposes Play, Pause and Stop buttons suitable for a tool bar. Each button binds to its own command and is disabled and visually muted when that command reports it cannot execute.
FavoriteCheckBoxA checkbox that displays a single favorite symbol (defaults to ★). The symbol and its checked/unchecked colors are customizable.
FileDropperA drop target that accepts files dragged from the operating system. Displays a prompt, an upload icon, and accepted file types. The border turns green for valid files and red for invalid files. Raises a FileDrop event when files are dropped.
FilesA lookless control that lists the files in a directory using a three-column view (Name with shell icon, Date Modified, Size). Supports single or multiple selection, an optional file-system watcher, manual refresh, and a FileActivated event.
FlipPanelA flip panel component that can display two different content sides and animate between them.
FontAutoCompleteBoxAn AutoCompleteBox that filters the font families installed on the system as you type and renders every suggestion in the font it names.
FontComboBoxA ComboBox that lists every font family installed on the system, exposing the selection as either a FontFamily or a font name, with optional in-font previews.
FontStyleComboBoxA ComboBox that lists the font styles (Normal, Italic, Oblique), rendering each entry in the style it names and exposing the selection as either a FontStyle or a style name.
FontWeightComboBoxA ComboBox that lists the standard font weights (Thin through ExtraBlack), rendering each entry in the weight it names and exposing the selection as either a FontWeight or a weight name.
GravatarImageDisplays a Gravatar Image for a specified email address.
HexColorTextBoxA ComboBox-based control that allows editing and selecting colors using hex strings (supports #RGB, #RRGGBB, #AARRGGBB) and named brushes.
HyperlinkRepresents a hyperlink control that displays text and provides navigation functionality.
InertiaScrollViewerRepresents a scroll viewer that supports inertia-based scrolling animations.
InfoCardAn info card with a highlight color on the left hand side.
InputWaveformVisualizerDisplays a waveform captured from a selectable Windows audio input device using WASAPI shared-mode capture so other applications can use the device concurrently.
LabeledSeparatorA labeled separator.
LoopbackWaveformVisualizerDisplays a waveform captured from the default Windows audio render device using WASAPI loopback capture. Follows changes to the default console render device automatically.
MarkdownEditorA self-contained markdown editor built on the Mosaic SyntaxEditor (AvalonEdit). Provides a formatting toolbar, list/heading helpers, markdown-aware key handling, an extended context menu, and document modification tracking.
MarkdownViewerA lookless, WPF-native Markdown viewer that renders Markdown text into a FlowDocument hosted in a read-only RichTextBox so formatted content can be selected and copied as rich text.
MessageBoxA themed, drop-in replacement for System.Windows.MessageBox. Mirrors the full set of Show overloads and reuses the standard WPF dialog enums. Switch with a single using alias. Honors the active Mosaic light/dark/high-contrast theme.
ModalDialogA lookless modal dialog that displays arbitrary content centered in a host element's adorner layer. While open, the host is dimmed and optionally blurred, focus is cycled inside the dialog, and ShowAsync completes with the value passed to Close.
NumericTextBoxTextBox that only allows digits, minus sign and a decimal point.
ProgressRingA progress ring component to indicate that a long running process is occurring.
PropertyGridA control that displays the properties of an object in a grid format.
RadialProgressBarRepresents a ProgressBar that renders its value as a circular arc, pie, or a ring of discrete shapes.
RelativePanelDefines an area within which you can position and align child objects in relation to each other or the parent panel.
ScalingTextBlockA TextBlock that attempts to scale the font size so all text fits within the available space. MinFontSize and MaxFontSize serve as the lower and upper boundaries.
SearchBoxA custom TextBox tailored for searching or filtering.
SettingsItemA settings item control.
ShadowPanelA panel control that applies a drop shadow effect to its child content. Provides properties to control shadow elevation and density/thickness.
ShadowTextBlockA TextBlock that automatically applies a configurable DropShadowEffect to its text via BlurRadius, ShadowDepth, and ShadowColor.
ShieldA shield component (shows a property and a value).
SideMenuRepresents a side menu control that displays a collection of menu items and allows item selection.
SimpleStackPanelArranges child elements into a single line that can be oriented horizontally or vertically that is more efficient that the normal StackPanel.
SliderRepeatButtonA RepeatButton variant used by slider templates that exposes radius orientation metadata for themed slider repeat surfaces.
SmallPanelRepresents a custom panel that arranges its child elements in a single layer and ensures that each child is measured and arranged within the available space.
SplitButtonRepresents a split button with a primary action surface and a separate drop-down surface that opens a context menu.
SplitPanelA two-pane container whose panes are separated by a draggable GridSplitter. The proportion of space allocated to the first pane is controlled by the two-way SplitterPosition property (0.0–1.0). Supports both vertical (top/bottom) and horizontal (side-by-side) orientation.
StopwatchDisplayRepresents a stopwatch control that provides functionality to display a stopwatch timer as UI element.
StringListEditorA StringListEditor component.
SymbolRatingA symbol rating component.
SyntaxEditorA code editor built on AvalonEdit that integrates with the Mosaic theming system and provides bundled, theme-aware syntax highlighting selected via the Language property. Includes custom key chords for commenting, uncommenting, and moving lines.
SystemDropShadowChromeCreates a theme specific look for drop shadow effects.
TabControlRepresents a tab control that allows users to switch between multiple tabs.
TableSizePickerA grid of cells used to pick a table size the way the Microsoft Word Insert Table button does. Hovering previews a region anchored at the upper left cell, clicking commits it and raises TableSizeSelected followed by RequestClose so a hosting popup, ribbon dropdown or context menu can close itself. Fully keyboard accessible.
TagBoxA specialized input control that turns typed text into removable, vibrantly-colored tags. Enter commits the current text as a tag, each tag has an ✕ button, and Backspace removes the last tag. Tags are surfaced through a bindable Tags collection.
ToggleButtonRepresents a button control that can switch between two states: checked and unchecked. This implementation looks like a theme styled switch.
ToggleSwitchRepresents a toggle switch control that allows users to switch between two states, such as "On" and "Off".
Toast / ToastManagerDisplays transient ToastMessage notification cards in a host element's adorner layer. Toasts support success, info, warning and error severities, timed or persistent dismissal, and quadrant-based positioning.
TwoPaneViewRepresents a container with two views that size and position content in the available space, either side-by-side or top-bottom.
TypingProgressRepresents a control that visually indicates typing progress, typically used in chat or messaging scenarios.
ValidationSummaryPanelA validation summary panel that displays all validation errors from child controls in a form. Supports both WPF's built-in validation and IDataErrorInfo/INotifyDataErrorInfo.
VersionTextBlockA TextBlock that displays an assembly version.
VT52TerminalA terminal emulator hosted inside an AvalonEdit TextEditor. Call Add(string) or Add(byte[]) with remote data; call SendKey/SendString for local keystrokes. Subscribe to Transmit to get bytes that the terminal sends back.
WDScrollViewerProvides a ScrollViewer with optional animated wheel scrolling.
WindowTitleBarA self-contained custom title bar control for borderless/chrome-less WPF windows. Automatically wires up drag-to-move, double-click maximize/restore, and the standard window system buttons.

Included Behaviors

The following table lists the behaviors found in src/Mosaic.UI.Wpf/Behaviors.

BehaviorDescription
AvalonEditBindingBehaviorAvalonEdit TextEditor binding behavior that allows for binding of the text property, the selected text property, the selection property, and the cursor position property.
AvalonEditCopyBehaviorA behavior that enables a Button to copy text from a specified AvalonEdit TextEditor to the clipboard.
AvalonEditPropertiesBehaviorA behavior that allows various common properties of an AvalonEdit TextEditor to be dynamically set or bound.
AvalonEditVtTerminalBehaviorA behavior that applies a retro VT/CRT terminal visual skin to an AvalonEdit TextEditor.
BlinkingBehaviorA behavior that makes any FrameworkElement blink using an opacity animation.
BlockCaretBehaviorA behavior that replaces the standard I-beam caret in a TextBox with a full-character-width block caret, similar to terminal emulators and classic text editors.
BrushModifierProvides attached properties and utility methods for modifying the appearance of brushes used in WPF controls, such as lightening the background color of elements.
ButtonOpenContextMenuBehavior that opens the ContextMenu of a Button when it is clicked.
CloseWindowOnEscapeCloses the current Window when the Escape key is pressed.
DataGridFilterBehaviorA behavior that allows a TextBox to filter a DataGrid.
DataGridLastColumnFillBehaviorA behavior that ensures the last column of a DataGrid fills the remaining available space.
FocusBehaviorSets keyboard focus to the attached control when it is loaded. If used on multiple controls, the last one loaded receives focus.
FrameworkElementZoomFontSizeOnMouseWheelBehaviorA behavior that enables zooming the font size of a FrameworkElement using the mouse wheel while the Ctrl key is held.
GridViewLastColumnFillBehaviorA behavior that ensures the last column of a ListView GridView fills the remaining available space.
GridViewSortBehaviorProvides attached properties and behaviors to enable sorting of a ListView's GridView columns when the column headers are clicked.
ItemsControlAutoScrollBehaviorScrolls an ItemsControl to the last item when the collection changes.
ItemsControlFilterBehaviorA behavior that allows a TextBox to filter an ItemsControl.
ListViewDeleteBehaviorDeletes selected ListView items when the Delete key is pressed.
OpenWindowBehaviorBehavior to open a new Window when attached to a ButtonBase or MenuItem.
TextBoxClearOnEscapeBehaviorClears the contents of a TextBoxBase when the Escape key is pressed.
TextBoxCopyBehaviorA behavior that enables a Button to copy text from a specified TextBox to the clipboard.
WindowChromeBehaviorAttached behavior to apply and maintain WindowChrome settings on a Window.