Skip to content

Kbd

Kbd renders a single key glyph (e.g. Ctrl) in a small muted, monospace-lettered pill. NaviusKbdGroup lays out a chord of NaviusKbd items horizontally with a small gap between them (e.g. Ctrl + Shift + P); it is an ItemsControl rather than a fixed two- or three-slot control, so any number of keys works.

xmlns:kbd="clr-namespace:Navius.Wpf.Ui.Kbd;assembly=Navius.Wpf.Ui"
<kbd:NaviusKbdGroup>
<kbd:NaviusKbd Content="Ctrl" />
<kbd:NaviusKbd Content="Shift" />
<kbd:NaviusKbd Content="P" />
</kbd:NaviusKbdGroup>
Property Type Default From Description
Content object - ContentControl The key label, e.g. "Ctrl".
ItemsSource / Items IEnumerable / ItemCollection - ItemsControl (via NaviusKbdGroup) The NaviusKbd entries in the chord.

NaviusKbd ships no custom automation peer; it is a plain ContentControl subclass, so whatever peer WPF’s ContentControl provides by default applies unmodified. Its style sets the inherited UIElement.Focusable to false (a Kbd glyph is presentational, not an interactive element), which a consumer can still override with a local value. NaviusKbdGroup likewise ships no custom peer, inheriting whatever ItemsControl provides by default. The unit suite verifies template application for a standalone NaviusKbd and for a NaviusKbdGroup hosting multiple keys.