Skip to content

Slider

Slider derives directly from the native Slider (Tier A), inheriting RangeBase value coercion, the Track/Thumb drag machinery, and SliderAutomationPeer’s UIA RangeValuePattern mapping. This M1 release is single-thumb only; multi-thumb range sliders, the web contract’s core feature, are deferred.

xmlns:navius="clr-namespace:Navius.Wpf.Primitives.Controls;assembly=Navius.Wpf.Primitives"
<navius:NaviusSlider x:Name="Volume"
Value="{Binding Volume, Mode=TwoWay}"
Minimum="0" Maximum="100" Step="5"
ValueCommitted="OnVolumeCommitted" />
Property Type Default From Description
Value double 0 System.Windows.Controls.Primitives.RangeBase Current value. Two-way bindable by default.
Minimum double 0 System.Windows.Controls.Primitives.RangeBase -
Maximum double 100 System.Windows.Controls.Slider Overridden from the native Slider’s default of 10 to match the contract’s Max default.
Step double 1 NaviusSlider Keyboard/drag increment, kept in sync with the inherited SmallChange and TickFrequency so pointer-drag snapping (IsSnapToTickEnabled, forced true) uses the same value.
LargeStep double 0 NaviusSlider 0 means the contract heuristic (max(Step, 10% of range snapped to Step)) is used via EffectiveLargeStep.
MinStepsBetweenThumbs int 0 NaviusSlider Navius extension for a future multi-thumb build; a no-op in this single-thumb release (no adjacent thumb to separate from).
EffectiveLargeStep (read-only) double - NaviusSlider Computed large-step value: the explicit LargeStep when > 0, otherwise NaviusSliderKeyboard.ComputeEffectiveLargeStep(LargeStep, Step, Minimum, Maximum).
IsDirectionReversed (inherited) bool false System.Windows.Controls.Slider Native property used directly for the contract’s Inverted; arrow-key direction flips when true.
Event Signature Fires when
ValueCommitted RoutedPropertyChangedEventHandler<double> On Thumb.DragCompleted (pointer-up) or immediately after any keyboard edit; distinct from the inherited per-change ValueChanged.
Key Behavior
ArrowRight / ArrowUp +Step (flips under IsDirectionReversed).
ArrowLeft / ArrowDown -Step (flips under IsDirectionReversed).
Shift + Arrow (any direction key) Uses EffectiveLargeStep instead of Step.
PageUp +EffectiveLargeStep. Does not flip under IsDirectionReversed.
PageDown -EffectiveLargeStep. Does not flip under IsDirectionReversed.
Home Jump to Minimum. Does not flip.
End Jump to Maximum. Does not flip.

Every key edit clamps to [Minimum, Maximum] and commits immediately (fires ValueCommitted). OnKeyDown is fully overridden rather than delegated to the base Slider’s key handling.

No custom AutomationPeer: NaviusSlider inherits SliderAutomationPeer, mapping to UIA RangeValuePattern (aria-valuemin/max/now parity). The unit suite exercises NaviusSliderKeyboard.TryGetTargetValue directly (a pure static function, tested without constructing real KeyEventArgs, which require a live PresentationSource) for every table entry including RTL/Inverted direction flips, ComputeEffectiveLargeStep, Step’s sync to SmallChange/TickFrequency, the Maximum = 100 override, and ValueCommitted firing on both Thumb.DragCompleted and keyboard edits. The control-level OnKeyDown wiring itself has no KeyEventArgs-level integration test, a stated pure-logic-first tradeoff rather than a gap.

  • Multi-thumb range sliders, the web contract’s core feature, are deferred: NaviusSlider is single-thumb only. MinStepsBetweenThumbs exists as a dependency property for API parity but is a no-op.
  • Residual (M6 audit, not fixed): RTL is documented as using native FlowDirection directly, but OnKeyDown passes only IsDirectionReversed into the keyboard logic. A horizontal slider set to FlowDirection.RightToLeft with IsDirectionReversed=false does not mirror ArrowLeft/Right, unlike the web contract’s “flips under RTL for horizontal, or Inverted.” The sibling Tabs handler does fold FlowDirection == RightToLeft into its RTL mirror, so the two families are inconsistent on this point; left as residual, not fixed, since the correct OR-vs-XOR combination of RTL and Inverted was not nailed down against the web source.
  • Inverted is not duplicated as a wrapper property; consumers set the native IsDirectionReversed directly.
  • Hidden <input> form-submission mirroring (Name/Form) is dropped entirely; no WPF form-submission model.
  • PART_Range is Track.DecreaseRepeatButton (a RepeatButton) restyled to a plain filled bar; unlike the web’s purely decorative <span> range, it stays clickable/page-steppable like a normal RepeatButton, a minor behavioral difference.
  • A vertical NaviusSlider rotates the whole horizontal template visual tree 270 degrees via a LayoutTransform rather than shipping a second vertical template; Track’s own value-to-position math is unaffected since it never observes an orientation change.
  • Attributes splat is dropped.

The Slider Gallery page rendered at the pinned commit, in each theme.

Slider Gallery page in the light theme

Slider Gallery page in the dark theme

Slider Gallery page in the high contrast theme