Avatar
Overview
Section titled “Overview”Avatar (NaviusAvatar) is a single lookless Control folding the web contract’s three parts
(Root/Fallback/Image) into one ControlTemplate that overlays a named PART_Image Image over a
fallback region, switching visibility off a Status dependency property. Status (Idle/
Loading/Loaded/Error) is driven internally by Source changes and BitmapImage download
events, and an optional DelayMs window suppresses the fallback from flashing during a fast load.
xmlns:navius="clr-namespace:Navius.Wpf.Primitives.Controls;assembly=Navius.Wpf.Primitives"
<navius:NaviusAvatar Source="https://example.com/avatar.png" DelayMs="200"> <navius:NaviusAvatar.Fallback> <TextBlock Text="LZ" /> </navius:NaviusAvatar.Fallback></navius:NaviusAvatar>Properties
Section titled “Properties”| Property | Type | Default | From | Description |
|---|---|---|---|---|
Source |
string? |
null |
NaviusAvatar |
Image URI/path. A (re)assigned non-empty value transitions Status to Loading until resolved via the BitmapImage download or the template Image’s ImageFailed. |
DelayMs |
int |
0 |
NaviusAvatar |
If <= 0, the fallback may render immediately; otherwise it waits DelayMs before the fallback is allowed to show. |
Fallback |
object? |
null |
NaviusAvatar |
Content shown while IsFallbackVisible is true. |
Status |
NaviusAvatarLoadStatus |
Idle |
NaviusAvatar |
Current load status (Idle/Loading/Loaded/Error). Normally driven internally by Source/image events; exposed as a public, settable dependency property (a deliberate deviation from the web’s internal-only status) for template triggers and tests. |
IsFallbackVisible |
bool |
true |
NaviusAvatar |
Read-only. True when Status != Loaded and the DelayMs window (if any) has elapsed. |
Events
Section titled “Events”| Event | Signature | Fires when |
|---|---|---|
LoadingStatusChanged |
RoutedPropertyChangedEventHandler<NaviusAvatarLoadStatus> |
Status transitions to a new value. |
UIA mechanism
Section titled “UIA mechanism”NaviusAvatar.cs has no OnCreateAutomationPeer() override, so no custom automation peer is
created for this control; the web contract also wires no ARIA role or aria-* attribute on any
Avatar part, so no specific UIA control-type parity is owed. Note: the parity doc’s own “WPF
strategy” section proposed mapping the composite to an explicit FrameworkElementAutomationPeer
(“plain ContentControl-level automation is sufficient”), but the shipped code does not add one;
this is a parity-doc-vs-code gap worth flagging rather than a verified fact about the family’s
runtime automation representation.
Web deltas
Section titled “Web deltas”- The web’s three parts (
NaviusAvatar/NaviusAvatarFallback/NaviusAvatarImage) fold into one looklessControlwith a single named template part (PART_Image), not three separate CLR types. Statusis exposed as a public, settable dependency property, unlike the web’s internal-onlyAvatarContext.Statussetter.- Load-state wiring is
BitmapImage.DownloadCompleted/DownloadFailedplus the templateImage’sImageFailedrouted event, the WPF async-image analog of the web’s nativeonload/onerror; WPF has no literal “ImageOpened” event, soDownloadCompletedstands in for it. A synchronous resolve (e.g. a pack/file URI with no async download) setsStatus = Loadeddirectly whenbitmap.IsDownloadingis alreadyfalseafterEndInit(). - No
data-state/status attribute is rendered anywhere in the web family either; the WPF port likewise adds no extra state marker beyondStatusitself.
Captures
Section titled “Captures”The Avatar Gallery page rendered at the pinned commit, in each theme.
![]()
![]()
![]()