Breadcrumb
Overview
Section titled “Overview”Breadcrumb is a root ItemsControl whose items are NaviusBreadcrumbItem and
NaviusBreadcrumbSeparator instances interleaved directly by the consumer, the same
manual-separator-placement contract as shadcn/ui’s own BreadcrumbList/BreadcrumbSeparator
anatomy. It wraps children in a horizontal WrapPanel so a long trail reflows on narrow widths
instead of clipping. NaviusBreadcrumbItem folds the web’s separate link/current-page parts
into one control: IsCurrentPage="False" renders as a clickable link, IsCurrentPage="True"
renders as plain, non-interactive text.
xmlns:breadcrumb="clr-namespace:Navius.Wpf.Ui.Breadcrumb;assembly=Navius.Wpf.Ui"
<breadcrumb:NaviusBreadcrumb> <breadcrumb:NaviusBreadcrumbItem Content="Home" /> <breadcrumb:NaviusBreadcrumbSeparator /> <breadcrumb:NaviusBreadcrumbItem Content="Projects" /> <breadcrumb:NaviusBreadcrumbSeparator /> <breadcrumb:NaviusBreadcrumbItem Content="Navius.Wpf" IsCurrentPage="True" /></breadcrumb:NaviusBreadcrumb>Properties
Section titled “Properties”| Property | Type | Default | From | Description |
|---|---|---|---|---|
Items |
ItemCollection |
empty | ItemsControl (NaviusBreadcrumb) |
Populated directly with NaviusBreadcrumbItem/NaviusBreadcrumbSeparator instances, not a data-bound ItemsSource. |
IsCurrentPage |
bool |
false |
NaviusBreadcrumbItem |
true marks the trail’s terminal, non-navigable entry: renders as plain text, sets Focusable to false, and stamps current onto AutomationProperties.ItemStatus. |
Command |
ICommand? |
null |
NaviusBreadcrumbItem |
Executed on activation (mouse or Enter/Space) when not the current page, via ICommandSource. |
CommandParameter |
object? |
null |
NaviusBreadcrumbItem |
Passed to Command. |
CommandTarget |
IInputElement? |
null |
NaviusBreadcrumbItem |
Command target; defaults to the item itself. |
Content |
object |
- |
ContentControl (NaviusBreadcrumbItem) |
The crumb’s label. |
NaviusBreadcrumbSeparator has no properties beyond the standard Control surface; it is a
purely decorative chevron glyph with Focusable and IsTabStop both fixed false.
Events
Section titled “Events”| Event | Signature | Fires when |
|---|---|---|
Click |
RoutedEventHandler |
A non-current NaviusBreadcrumbItem is activated by mouse or Enter/Space. Never raised while IsCurrentPage is true. |
Keyboard interactions
Section titled “Keyboard interactions”| Key | Behavior |
|---|---|
Tab |
Standard focus traversal across crumbs; a current-page item is excluded (Focusable = false). |
Enter / Space |
Activates a non-current crumb: raises Click and executes Command if set. No-op on the current-page item. |
UIA mechanism
Section titled “UIA mechanism”NaviusBreadcrumb does not override OnCreateAutomationPeer; ItemsControl’s base
implementation supplies ItemsControlAutomationPeer, which reports
AutomationControlType.List. The constructor also calls
AutomationProperties.SetItemStatus(this, "breadcrumb"), the closest UIA hook to a nav landmark,
surfaced through the inherited peer’s item-status property.
NaviusBreadcrumbItemAutomationPeer (a FrameworkElementAutomationPeer implementing
IInvokeProvider) overrides GetAutomationControlTypeCore() to report Hyperlink for a
navigable crumb and Text once IsCurrentPage is true. Toggling IsCurrentPage also stamps
AutomationProperties.ItemStatus to "current", the closest supported hook for the web’s
aria-current="page" since WPF/UIA has no dedicated current-page concept. The peer exposes the
UIA Invoke pattern only for a non-current crumb (GetPattern withholds it once IsCurrentPage
is true); Invoke itself additionally guards on IsEnabled and IsCurrentPage and throws
ElementNotEnabledException when either fails the check, so a UIA client that cached the provider
while the crumb was still navigable cannot activate it after it becomes the current page. An
enabled, non-current Invoke queues activation onto the item’s dispatcher
(DispatcherPriority.Input) per the UIA Invoke contract’s requirement to return immediately,
running the same Activate() path a mouse click or Enter/Space uses (raise Click, execute the
bound Command).
NaviusBreadcrumbSeparatorAutomationPeer overrides IsControlElementCore() to return false,
excluding the separator from the control view entirely so screen readers skip the chevron rather
than announcing a meaningless “separator” between crumb names.
The unit suite (tests/Navius.Wpf.Tests/UiBreadcrumbTests.cs) exercises NaviusBreadcrumbItem
defaults, IsCurrentPage toggling ItemStatus and Focusable, Click gating on
IsCurrentPage, NaviusBreadcrumbSeparator’s Focusable/IsTabStop being false, the item
peer’s Hyperlink/Text control type split, the Invoke pattern’s presence only on a
non-current crumb, the disabled- and current-page-throws behavior, an enabled Invoke raising
Click and executing a bound Command exactly once the dispatcher queue is pumped, and the
cached-provider case where a crumb becomes the current page after a UIA client already obtained
its Invoke provider. The M6 audit found this family clean: every foreground/ring brush is
sourced via DynamicResource, no C# template-part lookup, no animation, no two-way-to-readonly
binding.
Web deltas
Section titled “Web deltas”IsCurrentPagedrivesAutomationProperties.ItemStatus = "current"rather thanaria-current="page": WPF/UIA has no dedicated current-page concept, soItemStatusis the closest supported hook for assistive technology.