Label
Overview
Section titled “Overview”Label derives from the native System.Windows.Controls.Label and resolves a string For
id to a FrameworkElement by name-scope lookup, assigning the inherited Label.Target and
AutomationProperties.LabeledBy on it. It also adds explicit click-to-focus and a
double/triple-click text-selection-suppression guard from scratch, since WPF’s native
Label.Target only drives access-key/mnemonic activation, not a plain mouse click the way
the HTML for= attribute does in a browser.
xmlns:navius="clr-namespace:Navius.Wpf.Primitives.Controls;assembly=Navius.Wpf.Primitives"
<StackPanel> <navius:NaviusLabel For="Email" Content="Email address" /> <TextBox x:Name="Email" /></StackPanel>Properties
Section titled “Properties”| Property | Type | Default | From | Description |
|---|---|---|---|---|
For |
string? |
null |
NaviusLabel |
The name of the associated control, resolved via FindName walking up the logical/visual tree from the label. Resolution is retried on Loaded and re-attempted eagerly on property change. |
Target |
FrameworkElement? |
null |
Label |
Native focus target. Assigned automatically once For resolves; can also be set directly for the native access-key/mnemonic activation path. |
Content |
object |
- |
ContentControl |
Label caption content, inherited via Label. |
Keyboard interactions
Section titled “Keyboard interactions”| Key | Behavior |
|---|---|
Access key (Alt + underlined character in Content) |
Native Label/AccessText mnemonic activation moves focus to Target; the default template preserves RecognizesAccessKey="True". |
UIA mechanism
Section titled “UIA mechanism”NaviusLabel ships no custom AutomationPeer and inherits WPF’s native LabelAutomationPeer.
AutomationProperties.SetLabeledBy(resolved, this) is set on the resolved Target at the same
time Target is assigned, preserving the DOM for=’s screen-reader label association. The unit
suite (LabelTests) exercises For resolution and LabeledBy wiring, single-click focus
forwarding, and double/triple-click suppression (e.ClickCount > 1).
Web deltas
Section titled “Web deltas”Forstays a plainstring?dependency property rather than becoming a bound object reference: it resolves to aFrameworkElementviaFindName, mirroring the DOM’sfor=id lookup, rather than using WPF’s nativeTargetobject-reference pattern directly (thoughTargetremains settable for consumers who prefer it).- Click-to-focus and the double/triple-click text-selection-suppression guard are authored from
scratch in an
OnMouseDownoverride; the web component gets this behavior for free from the browser’s nativefor=handling, so there was no existing logic to translate. - The
data-navius-labelmarker attribute has no WPF equivalent (no arbitrarydata-*attribute concept) and was not replicated. Attributes(CaptureUnmatchedValuespassthrough on the web) is dropped globally across this batch of families; no extensibility story was built for arbitrary attribute forwarding.- M6 audit residual (not a defect):
OnMouseDownfires for any mouse button, not just the left button. The web’sonmousedownis likewise button-agnostic, so this is arguably parity, but right-click focus-forwarding was not evaluated against AT expectations.
Captures
Section titled “Captures”The Label Gallery page rendered at the pinned commit, in each theme.


