Class RangeSliderBuilder
- Namespace
- SharpConsoleUI.Builders
- Assembly
- SharpConsoleUI.dll
Fluent builder for creating RangeSliderControl instances.
public sealed class RangeSliderBuilder : IControlBuilder<RangeSliderControl>
- Inheritance
-
RangeSliderBuilder
- Implements
- Inherited Members
- Extension Methods
Constructors
RangeSliderBuilder()
Initializes a new instance of the RangeSliderBuilder class.
public RangeSliderBuilder()
Methods
Build()
Builds the RangeSliderControl instance.
public RangeSliderControl Build()
Returns
Fill()
Sets vertical alignment to Fill (useful for vertical sliders in a container).
public RangeSliderBuilder Fill()
Returns
Horizontal()
Sets the slider to horizontal orientation.
public RangeSliderBuilder Horizontal()
Returns
OnHighValueChanged(EventHandler<double>)
Registers a handler for high value changes.
public RangeSliderBuilder OnHighValueChanged(EventHandler<double> handler)
Parameters
handlerEventHandler<double>
Returns
OnLowValueChanged(EventHandler<double>)
Registers a handler for low value changes.
public RangeSliderBuilder OnLowValueChanged(EventHandler<double> handler)
Parameters
handlerEventHandler<double>
Returns
OnRangeChanged(EventHandler<(double Low, double High)>)
Registers a handler for range changes (fires with both low and high values).
public RangeSliderBuilder OnRangeChanged(EventHandler<(double Low, double High)> handler)
Parameters
handlerEventHandler<(double Low, double High)>
Returns
ShowMinMaxLabels(bool)
Enables showing min and max labels at the track ends.
public RangeSliderBuilder ShowMinMaxLabels(bool show = true)
Parameters
showbool
Returns
ShowValueLabel(bool)
Enables showing the range value label.
public RangeSliderBuilder ShowValueLabel(bool show = true)
Parameters
showbool
Returns
Stretch()
Sets the control to stretch to fill available width.
public RangeSliderBuilder Stretch()
Returns
Vertical()
Sets the slider to vertical orientation.
public RangeSliderBuilder Vertical()
Returns
Visible(bool)
Sets the visibility.
public RangeSliderBuilder Visible(bool visible)
Parameters
visiblebool
Returns
WithAlignment(HorizontalAlignment)
Sets the horizontal alignment.
public RangeSliderBuilder WithAlignment(HorizontalAlignment alignment)
Parameters
alignmentHorizontalAlignment
Returns
WithBackgroundColor(Color)
Sets the background color.
public RangeSliderBuilder WithBackgroundColor(Color color)
Parameters
colorColor
Returns
WithFilledTrackColor(Color)
Sets the filled track color (between thumbs).
public RangeSliderBuilder WithFilledTrackColor(Color color)
Parameters
colorColor
Returns
WithFocusedThumbColor(Color)
Sets the focused/active thumb color.
public RangeSliderBuilder WithFocusedThumbColor(Color color)
Parameters
colorColor
Returns
WithHeight(int)
Sets the height (useful for vertical sliders).
public RangeSliderBuilder WithHeight(int height)
Parameters
heightint
Returns
WithHighValue(double)
Sets the high value.
public RangeSliderBuilder WithHighValue(double value)
Parameters
valuedouble
Returns
WithLargeStep(double)
Sets the large step increment.
public RangeSliderBuilder WithLargeStep(double largeStep)
Parameters
largeStepdouble
Returns
WithLowValue(double)
Sets the low value.
public RangeSliderBuilder WithLowValue(double value)
Parameters
valuedouble
Returns
WithMargin(Margin)
Sets the margin.
public RangeSliderBuilder WithMargin(Margin margin)
Parameters
marginMargin
Returns
WithMargin(int, int, int, int)
Sets the margin.
public RangeSliderBuilder WithMargin(int left, int top, int right, int bottom)
Parameters
Returns
WithMinRange(double)
Sets the minimum required gap between low and high values.
public RangeSliderBuilder WithMinRange(double minRange)
Parameters
minRangedouble
Returns
WithName(string)
Sets the control name.
public RangeSliderBuilder WithName(string name)
Parameters
namestring
Returns
WithRange(double, double)
Sets the min and max range.
public RangeSliderBuilder WithRange(double min, double max)
Parameters
Returns
WithStep(double)
Sets the step increment.
public RangeSliderBuilder WithStep(double step)
Parameters
stepdouble
Returns
WithTag(object)
Sets an arbitrary tag object.
public RangeSliderBuilder WithTag(object tag)
Parameters
tagobject
Returns
WithThumbColor(Color)
Sets the inactive thumb color.
public RangeSliderBuilder WithThumbColor(Color color)
Parameters
colorColor
Returns
WithTrackColor(Color)
Sets the unfilled track color.
public RangeSliderBuilder WithTrackColor(Color color)
Parameters
colorColor
Returns
WithValueFormat(string)
Sets the format string for value labels.
public RangeSliderBuilder WithValueFormat(string format)
Parameters
formatstring
Returns
WithValues(double, double)
Sets both low and high values.
public RangeSliderBuilder WithValues(double low, double high)
Parameters
Returns
WithVerticalAlignment(VerticalAlignment)
Sets the vertical alignment.
public RangeSliderBuilder WithVerticalAlignment(VerticalAlignment alignment)
Parameters
alignmentVerticalAlignment
Returns
WithWidth(int)
Sets the width.
public RangeSliderBuilder WithWidth(int width)
Parameters
widthint