Skip to content

Spinner

Spinner is a rotating-arc loading indicator, indeterminate only; for a determinate progress bar use Navius.Wpf.Primitives’ NaviusProgress instead. Its template renders a roughly 270-degree arc (a large-arc-flag Path, matching the lucide Loader2 glyph) rotated by an unbounded RotateTransform storyboard. ShouldAnimate is read once at construction from ReducedMotion.AnimationsEnabled, the same guard NaviusSkeleton applies to its loop: when the OS “reduce animations” preference is on, the arc renders statically instead of spinning forever.

xmlns:spinner="clr-namespace:Navius.Wpf.Ui.Spinner;assembly=Navius.Wpf.Ui"
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Navius.Wpf.Ui;component/Themes/Spinner.xaml" />
</ResourceDictionary.MergedDictionaries>
<spinner:NaviusSpinner />
Property Type Default From Description
ShouldAnimate bool true NaviusSpinner Read-only. Snapshotted at construction from ReducedMotion.AnimationsEnabled; gates the rotation storyboard in Themes/Spinner.xaml. Not settable by a consumer.

Default Width/Height are 16x16, set by the style in Themes/Spinner.xaml.

The constructor calls AutomationProperties.SetName(this, "Loading"), setting the Name attached property. NaviusSpinner ships its own NaviusSpinnerAutomationPeer (a FrameworkElementAutomationPeer) reporting AutomationControlType.ProgressBar, the honest type for an indeterminate loading indicator (NaviusProgress is the determinate sibling); no RangeValue pattern is exposed, since the spin is indeterminate and there is no meaningful min/now/max to report. The peer lets the inherited GetName surface the constructor-set AutomationProperties.Name, so “Loading” now reaches the UI Automation tree. The M6 audit called this family “clean and exemplary” for gating its rotation Storyboard on ShouldAnimate, itself snapshotted from ReducedMotion.AnimationsEnabled, and for sourcing its Foreground via DynamicResource. The unit suite (UiSpinnerTests.cs) verifies the peer reports AutomationControlType.ProgressBar and surfaces the “Loading” name, and separately that ShouldAnimate flips with ReducedMotion.SetTestOverride(() => true/false) and that the template applies with Themes/Spinner.xaml merged.