Class SliderBuilder
- Namespace
- SharpConsoleUI.Builders
- Assembly
- SharpConsoleUI.dll
Fluent builder for creating SliderControl instances.
public sealed class SliderBuilder : IControlBuilder<SliderControl>
- Inheritance
-
SliderBuilder
- Implements
- Inherited Members
- Extension Methods
Constructors
SliderBuilder()
Initializes a new instance of the SliderBuilder class.
public SliderBuilder()
Methods
Build()
Builds the SliderControl instance.
public SliderControl Build()
Returns
Fill()
Sets vertical alignment to Fill (useful for vertical sliders in a container).
public SliderBuilder Fill()
Returns
Horizontal()
Sets the slider to horizontal orientation.
public SliderBuilder Horizontal()
Returns
OnValueChanged(EventHandler<double>)
Registers a handler for value changes.
public SliderBuilder OnValueChanged(EventHandler<double> handler)
Parameters
handlerEventHandler<double>
Returns
ShowMinMaxLabels(bool)
Enables showing min and max labels at the track ends.
public SliderBuilder ShowMinMaxLabels(bool show = true)
Parameters
showbool
Returns
ShowValueLabel(bool)
Enables showing the current value label.
public SliderBuilder ShowValueLabel(bool show = true)
Parameters
showbool
Returns
StickyBottom()
Makes the control stick to the bottom during scrolling.
public SliderBuilder StickyBottom()
Returns
StickyTop()
Makes the control stick to the top during scrolling.
public SliderBuilder StickyTop()
Returns
Stretch()
Sets the control to stretch to fill available width.
public SliderBuilder Stretch()
Returns
Vertical()
Sets the slider to vertical orientation.
public SliderBuilder Vertical()
Returns
Visible(bool)
Sets the visibility.
public SliderBuilder Visible(bool visible)
Parameters
visiblebool
Returns
WithAlignment(HorizontalAlignment)
Sets the horizontal alignment.
public SliderBuilder WithAlignment(HorizontalAlignment alignment)
Parameters
alignmentHorizontalAlignment
Returns
WithBackgroundColor(Color)
Sets the background color.
public SliderBuilder WithBackgroundColor(Color color)
Parameters
colorColor
Returns
WithFilledTrackColor(Color)
Sets the filled track color.
public SliderBuilder WithFilledTrackColor(Color color)
Parameters
colorColor
Returns
WithFocusedThumbColor(Color)
Sets the focused thumb color.
public SliderBuilder WithFocusedThumbColor(Color color)
Parameters
colorColor
Returns
WithHeight(int)
Sets the height (useful for vertical sliders).
public SliderBuilder WithHeight(int height)
Parameters
heightint
Returns
WithLargeStep(double)
Sets the large step increment (Page Up/Down, Shift+Arrow).
public SliderBuilder WithLargeStep(double largeStep)
Parameters
largeStepdouble
Returns
WithMargin(Margin)
Sets the margin.
public SliderBuilder WithMargin(Margin margin)
Parameters
marginMargin
Returns
WithMargin(int, int, int, int)
Sets the margin.
public SliderBuilder WithMargin(int left, int top, int right, int bottom)
Parameters
Returns
WithName(string)
Sets the control name.
public SliderBuilder WithName(string name)
Parameters
namestring
Returns
WithRange(double, double)
Sets the min and max range.
public SliderBuilder WithRange(double min, double max)
Parameters
Returns
WithStep(double)
Sets the step increment.
public SliderBuilder WithStep(double step)
Parameters
stepdouble
Returns
WithTag(object)
Sets an arbitrary tag object.
public SliderBuilder WithTag(object tag)
Parameters
tagobject
Returns
WithThumbColor(Color)
Sets the thumb color.
public SliderBuilder WithThumbColor(Color color)
Parameters
colorColor
Returns
WithTrackColor(Color)
Sets the unfilled track color.
public SliderBuilder WithTrackColor(Color color)
Parameters
colorColor
Returns
WithValue(double)
Sets the current value.
public SliderBuilder WithValue(double value)
Parameters
valuedouble
Returns
WithValueFormat(string)
Sets the format string for value labels.
public SliderBuilder WithValueFormat(string format)
Parameters
formatstring
Returns
WithVerticalAlignment(VerticalAlignment)
Sets the vertical alignment.
public SliderBuilder WithVerticalAlignment(VerticalAlignment alignment)
Parameters
alignmentVerticalAlignment
Returns
WithWidth(int)
Sets the width.
public SliderBuilder WithWidth(int width)
Parameters
widthint