ArionSlider class Core

A slider: a value between ArionSlider.Minimum and ArionSlider.Maximum in steps of ArionSlider.Step, picked by pressing and dragging along the track or by the keyboard - the arrows by a step, Page Up/Down by ArionSlider.LargeStep, Home and End to the ends. Like CheckBox it holds no value of its own: ArionSlider.Value reads it and ArionSlider.Changed hands a new one over, so the application keeps one source.

Styling. From the style sheets (Select.Type<ArionSlider>()): the empty track (background) and its corner radius, the filled part and the thumb (accent colour), the ring around the thumb (border colour and width), a glow around the thumb (shadow and shadow blur - the theme lights it on hover and while pressed), the label's text and the opacity (the theme halves it while disabled).

A screen reader reads it as a slider with a value, and may set one (ArionSlider.SetAccessibleValue).

public sealed class ArionSlider : Control
Namespace
ArionUI.Presentation.Controls
Package
ArionUI.Presentation · dotnet add package ArionUI.Presentation --prerelease
Inherits
Control

Constructors

ArionSlider

public ArionSlider();

Properties

AccessibleRange

public override AccessibleRange? AccessibleRange { get; }

The range of a part that picks a value along one (a slider); null otherwise.

AccessibleValue

public override string? AccessibleValue { get; }

The text of a text part; null when the part carries no value.

Changed

public required Action<double> Changed { get; init; }

Called with the new value when the user moves the slider (never with the value it already has); store it where ArionSlider.Value reads it.

Cursor

public override GridCursor Cursor { get; }

DrawsOwnFocus

public override bool DrawsOwnFocus { get; }

The control shows its focus itself (accent border, hover row, ring parameter). False = the host draws the shared default ring around Control.Bounds.

Focusable

public override bool Focusable { get; }

Can this KIND of control hold the keyboard focus? Combined with the live probes in Control.CanTakeFocus.

Format

public Func<double, string>? Format { get; init; }

How the value is written for a screen reader; null writes the number in the current culture.

LargeStep

public double LargeStep { get; init; }

What Page Up and Page Down move; 0 (the default) takes a tenth of the range.

Maximum

public double Maximum { get; init; }

The value at the right end. It need not lie on a step: the slider stops at the steps from ArionSlider.Minimum and at ArionSlider.Maximum itself (End goes there), so 0 to 47 in steps of 5 offers 0, 5, … 45 and 47.

Minimum

public double Minimum { get; init; }

The value at the left end.

Role

public override ControlRole Role { get; }

What KIND of part this is for assistive technology — the automation peers translate it into their host's control type.

Spoken

public Func<string>? Spoken { get; init; }

The slider's name for a screen reader ("Corner radius").

Step

public double Step { get; init; }

The values the slider stops at, counted from ArionSlider.Minimum, and what an arrow key moves; 0 lets it move freely (an arrow then moves a hundredth).

Value

public required Func<double> Value { get; init; }

The current value, asked each time it is drawn.

Methods

Measure

public override LogSize Measure(LogSize available);

The whole width it is given, one line high.

OnKey

public override bool OnKey(ArionKey key, ArionModifiers mods);

Keys while focused. Return false to let the pane's fallback see the key.

OnPointerMoved

public override void OnPointerMoved(LogPoint p, bool buttonDown);

OnPointerPressed

public override void OnPointerPressed(LogPoint p, ArionModifiers mods, int clickCount);

OnPointerReleased

public override void OnPointerReleased(LogPoint p);

Render

public override void Render(IRenderSurface s, ControlFrame frame);

SetAccessibleRangeValue

public override bool SetAccessibleRangeValue(double value);

Sets the value a screen reader asks for, snapped to the steps and kept in range. False when disabled.

SetAccessibleValue

public override bool SetAccessibleValue(string value);

Sets the value a screen reader typed, in the current culture or the invariant one, snapped to the steps and kept in range. False when disabled or not a number.

Snap

public double Snap(double v);

v kept in range and on the steps - or on ArionSlider.Maximum, when that is nearer than the last step.

SpokenLabel

public override string? SpokenLabel();

What a screen reader speaks when this control receives the focus. A control that cannot take the focus but answers here is READ: it becomes a text part.