Class SlideSwitch
- Namespace
- PluginUI
- Assembly
- PluginUI.dll
Toggle switch: a pill with a sliding knob (animated), with an optional caption on the right (or OnText/OffText state captions).
public class SlideSwitch : ValueControl
- Inheritance
-
SlideSwitch
- Inherited Members
Constructors
SlideSwitch()
Creates a slide switch.
public SlideSwitch()
SlideSwitch(string, bool)
Creates a slide switch with a caption.
public SlideSwitch(string text, bool isOn = false)
Parameters
Properties
DefaultSize
Natural size used when no explicit size is given.
protected override Size DefaultSize { get; }
Property Value
IsOn
true in the on state.
public bool IsOn { get; set; }
Property Value
OffText
Caption in the off state (replaces Text).
public string? OffText { get; set; }
Property Value
OnText
Caption in the on state (replaces Text).
public string? OnText { get; set; }
Property Value
Text
Caption drawn right of the switch.
public string? Text { get; set; }
Property Value
TrackHeight
Height of the pill in DIPs.
public float TrackHeight { get; set; }
Property Value
ValueText
Text drawn in the value area (null = no value area).
public override string? ValueText { get; }
Property Value
Methods
OnAttached()
Called when the element joins a host (subscribe to external events here).
protected override void OnAttached()
OnKeyDown(KeyEventArgs)
Key pressed while focused (bubbles to parents).
protected override void OnKeyDown(KeyEventArgs e)
Parameters
OnMouseDown(MouseEventArgs)
Mouse button pressed over the element (or captured).
protected override void OnMouseDown(MouseEventArgs e)
Parameters
OnMouseUp(MouseEventArgs)
Mouse button released.
protected override void OnMouseUp(MouseEventArgs e)
Parameters
OnValueChanged()
Called after every value change; raises ValueChanged and repaints.
protected override void OnValueChanged()
RenderVector(DrawingContext, Rect, VectorStyle)
Vector rendering of the widget area.
protected override void RenderVector(DrawingContext dc, Rect widget, VectorStyle style)
Parameters
dcDrawingContextwidgetRectstyleVectorStyle