AccessibleIcon
Overview
Section titled “Overview”AccessibleIcon is a lookless ContentControl that wraps arbitrary icon content (typically a
Path or a vector Image) and applies an accessible name to it via
AutomationProperties.Name. It is the WPF-native replacement for the web contract’s separate
visually-hidden label <span>: WPF’s automation tree is driven by AutomationPeer/
AutomationProperties.Name, not a hidden DOM text node, so there is nothing to hide visually.
xmlns:navius="clr-namespace:Navius.Wpf.Primitives.Controls;assembly=Navius.Wpf.Primitives"
<navius:NaviusAccessibleIcon Label="Close"> <Path Data="M0,0 L10,10 M10,0 L0,10" Stroke="Black" StrokeThickness="2" /></navius:NaviusAccessibleIcon>Properties
Section titled “Properties”| Property | Type | Default | From | Description |
|---|---|---|---|---|
Label |
string? |
null |
NaviusAccessibleIcon |
The accessible name. Applied via AutomationProperties.SetName on Content (when Content is a DependencyObject) and re-applied whenever Label or Content changes. |
Content |
object |
- |
ContentControl |
The icon element (for example a Path or Image); should be decorative on its own. |
UIA mechanism
Section titled “UIA mechanism”NaviusAccessibleIconAutomationPeer (a FrameworkElementAutomationPeer) overrides
GetNameCore() to return Label (or an empty string), GetAutomationControlTypeCore() to
report AutomationControlType.Image, and both IsControlElementCore()/IsContentElementCore()
to false when Label is null or empty, excluding the wrapper from both UIA tree views
entirely in that case: the WPF analog of the web contract never rendering the hidden label
span when unset. AutomationProperties.SetName is also applied directly to Content, so the
name is discoverable through the nested element’s own peer as well as the wrapper’s. The unit
suite (AccessibleIconTests) exercises both the peer and the content-name propagation.
Web deltas
Section titled “Web deltas”- The web contract renders the icon verbatim plus a separate visually-hidden
<span>carrying the label text; WPF has no DOM text-node/CSS-clip equivalent, so this port setsAutomationProperties.Namedirectly instead of emitting any hidden element. Attributesforwarding (CaptureUnmatchedValueson the web) is dropped; WPF has no free-form attribute-bag equivalent.- This control is also the concrete replacement pattern for the retired
NaviusVisuallyHiddenfamily (see the VisuallyHidden manifest): consumers that need content present to assistive technology but invisible to sighted users setAutomationProperties.Namedirectly rather than wrapping a hidden text node. - M6 audit found no confirmed or plausible disparities against this doc’s claims.