Controls

Child Pages

Badged Control

Badged wraps a control and draws a small badge over one of its corners or edges — an unread count, a status, a short word.

ColorPicker

The ColorPicker controls can be used to select any System.Windows.Media.Color (in this document simply called Color). There are four different controls available to select a Color.

ContentControlEx

ContentControlEx is a ContentControl with two extra properties and one piece of behaviour that has no property at all. You rarely place one yourself — it is the presenter inside most MahApps templates, which is where its properties come from.

CustomValidationPopup

CustomValidationPopup is the popup that carries a validation message next to the control that failed. You almost never place one: it is part of MahApps.Templates.ValidationError, so every styled input control already has one. See Validation for the error template as a whole.

DateTimePicker

DateTimePicker is a text field with a drop-down that holds a calendar, an analogue clock and three lists for hour, minute and AM/PM. TimePicker is the same control without the calendar; both derive from TimePickerBase, so everything below applies to either unless it mentions a date.

DropDownButton

DropDownButton is a button with a list attached. The whole button is one surface: clicking it runs its Command and opens the menu.

FlipView

FlipView shows one item at a time and flips between them with animated transitions. It derives from Selector, so it is an items control with a selection — ItemsSource, Items, SelectedItem and SelectedIndex all work as usual.

Flyouts

A Flyout is a panel that slides in over a MetroWindow from any of its four sides. It derives from HeaderedContentControl, so it has a Header and arbitrary content.

FontIcon

FontIcon draws one character from a symbol font. That is the whole control: a Glyph property and a template that puts it in a TextBlock.

HamburgerMenu

The HamburgerMenu is a navigation control: a list of destinations in a pane that collapses to a strip of icons, next to the content of whatever is selected. It wraps a SplitView for the pane behaviour and adds the item list, the hamburger button, an options list pinned to the bottom, and a content area.

HotKeyBox

HotKeyBox is a field that records whatever key combination the user presses into it, the way a set shortcut box in an options dialog does. It derives from Control and its only template part is a read-only TextBox.

MetroAnimatedSingleRowTabControl

MetroAnimatedSingleRowTabControl is MetroAnimatedTabControl with one difference: its tab headers stay on a single row and scroll, instead of wrapping onto further rows.

MetroAnimatedTabControl

MetroAnimatedTabControl is a MetroTabControl whose content slides in when you switch tabs. The class itself is four lines — it derives from BaseMetroTabControl and only points at a different default style. Everything below is that style.

MetroContentControl

MetroContentControl is a ContentControl that plays a short slide-and-fade whenever it appears. It is what gives a MahApps page its characteristic entrance.

MetroHeader

MetroHeader puts a header above a piece of content — usually a label above an input control. It derives from GroupBox, so Header, HeaderTemplate, HeaderTemplateSelector and HeaderStringFormat all come from HeaderedContentControl and behave as usual. What MahApps adds is the template: a plain two-row grid with no border and no chrome.

MetroNavigationWindow

MetroNavigationWindow is WPF's NavigationWindow rebuilt on top of MetroWindow: a window with a back/forward bar, a page title, and a Frame that hosts navigated Pages.

MetroProgressBar

MetroProgressBar derives from ProgressBar and replaces its template. Determinate, it is a flat bar without a frame; indeterminate, it is five dots sweeping across instead of a striped fill.

MetroTabControl

MetroTabControl looks like a styled TabControl and adds three things: a close button per tab, a say in whether tab contents survive a switch, and a margin for the strip.

MetroTabItem

MetroTabItem is a TabItem with a close button and the four properties around it. It is what MetroTabControl creates for you when you bind ItemsSource, and its style is based on MahApps.Styles.TabItem, so everything on the TabControl styles page applies here too.

MetroThumbContentControl

MetroThumbContentControl is a Thumb that can hold arbitrary content. WPF's own Thumb is a Control with a template, so wrapping content in it is awkward; this one derives from ContentControlEx instead and raises the same three drag events.

MultiFrameImage

An .ico file holds the same artwork several times over, drawn for different sizes. WPF's Image takes one of those frames and stretches it; MultiFrameImage picks the frame that suits the size it is being drawn at.

MultiSelectionComboBox

The MultiSelectionComboBox is like a normal ComboBox, but instead of limit the selection to one item, the user is allowed to select multiple items.

NumericUpDown

NumericUpDown is a text field for a number, with a button to step it up and one to step it down.

ProgressRing

ProgressRing is the Windows 8 activity indicator: dots chasing each other around a circle. It shows that something is happening, not how far along it is — there is no Value, and it derives from Control, not from ProgressBar.

RangeSlider

RangeSlider picks a range rather than a value. It has three thumbs — one at each end and one for the band between them — and derives from RangeBase, so Minimum, Maximum, SmallChange and LargeChange are the familiar ones. The range itself is LowerValue and UpperValue.

SplitButton

SplitButton is a button split into two halves: the left runs a command, the right opens a list. Picking from the list changes what the left half shows.

SplitView

The SplitView is a container with two areas: a pane that can be expanded and collapsed, and the content next to it. It is the control behind the navigation drawer pattern known from Windows 10/11 apps — a narrow strip of icons that slides open into a full menu.

Tile

Tile is a square button that looks like a tile from the Windows 8 or 10 Start screen: a coloured block with a caption in a corner and room for an icon in the middle.

TimePicker

TimePicker is a text field with a drop-down for picking a time. It is DateTimePicker without the calendar half — both derive from TimePickerBase and share one control template.

ToggleSwitch

ToggleSwitch is an on/off switch. It does the same job as a CheckBox but says its state in words as well as shape, and it is easier to hit with a finger. It derives from HeaderedContentControl and implements ICommandSource.

TransitioningContentControl

TransitioningContentControl animates between two contents: assign a new Content and the old one is animated out while the new one is animated in. It is a ContentControl, so it holds one child at a time.

WindowButtonCommands

WindowButtonCommands is the group of three buttons at the right end of a MetroWindow's title bar: minimise, maximise/restore and close. Every MetroWindow has one, so you rarely place it yourself — but you may well want to hook or restyle it.

WindowCommands

WindowCommands holds the buttons a MetroWindow puts in its title bar, left or right of the title. It is what you fill to add settings, about or a login indicator up there.

MetroWindow

MetroWindow replaces WPF's Window. Using it is what gives an application the MahApps title bar, and it is the host for flyouts, dialogs and the title-bar commands. If you are starting out, read the Quick Start first.

Related Sections