Class Slider
A control that lets the user select from a range of values by moving a Thumb control along a Track.
[TemplatePart("PART_DecreaseButton", typeof(Button))]
[TemplatePart("PART_IncreaseButton", typeof(Button))]
[TemplatePart("PART_Track", typeof(Track))]
[PseudoClasses(new string[] { ":vertical", ":horizontal", ":pressed" })]
public class Slider : RangeBase, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue
- Inheritance
-
Slider
- Implements
- Inherited Members
- Extension Methods
Constructors
Slider()
Instantiates a new instance of the Slider class.
public Slider()
Fields
IsDirectionReversedProperty
Defines the IsDirectionReversed property.
public static readonly StyledProperty<bool> IsDirectionReversedProperty
Field Value
IsSnapToTickEnabledProperty
Defines the IsSnapToTickEnabled property.
public static readonly StyledProperty<bool> IsSnapToTickEnabledProperty
Field Value
OrientationProperty
Defines the Orientation property.
public static readonly StyledProperty<Orientation> OrientationProperty
Field Value
TickFrequencyProperty
Defines the TickFrequency property.
public static readonly StyledProperty<double> TickFrequencyProperty
Field Value
TickPlacementProperty
Defines the TickPlacement property.
public static readonly StyledProperty<TickPlacement> TickPlacementProperty
Field Value
TicksProperty
Defines the Ticks property.
public static readonly StyledProperty<AvaloniaList<double>?> TicksProperty
Field Value
Properties
IsDirectionReversed
Gets or sets the direction of increasing value.
public bool IsDirectionReversed { get; set; }
Property Value
- bool
true if the direction of increasing value is to the left for a horizontal slider or down for a vertical slider; otherwise, false. The default is false.
IsDragging
Gets a value indicating whether the Slider is currently being dragged.
protected bool IsDragging { get; }
Property Value
IsSnapToTickEnabled
Gets or sets a value that indicates whether the Slider automatically moves the Thumb to the closest tick mark.
public bool IsSnapToTickEnabled { get; set; }
Property Value
Orientation
Gets or sets the orientation of a Slider.
public Orientation Orientation { get; set; }
Property Value
TickFrequency
Gets or sets the interval between tick marks.
public double TickFrequency { get; set; }
Property Value
TickPlacement
Gets or sets a value that indicates where to draw tick marks in relation to the track.
public TickPlacement TickPlacement { get; set; }
Property Value
Ticks
Defines the ticks to be drawn on the tick bar.
public AvaloniaList<double>? Ticks { get; set; }
Property Value
Track
protected Track? Track { get; }
Property Value
Methods
OnApplyTemplate(TemplateAppliedEventArgs)
Called when the control's template is applied. In simple terms, this means the method is called just before the control is displayed.
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
Parameters
e
TemplateAppliedEventArgsThe event args.
OnCreateAutomationPeer()
Returns a new, type-specific AutomationPeer implementation for the control.
protected override AutomationPeer OnCreateAutomationPeer()
Returns
- AutomationPeer
The type-specific AutomationPeer implementation.
OnKeyDown(KeyEventArgs)
Called before the KeyDown event occurs.
protected override void OnKeyDown(KeyEventArgs e)
Parameters
e
KeyEventArgsThe event args.
OnPropertyChanged(AvaloniaPropertyChangedEventArgs)
Called when a avalonia property changes on the object.
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
Parameters
change
AvaloniaPropertyChangedEventArgsThe property change details.
OnThumbDragCompleted(VectorEventArgs)
Called when user stop dragging the Thumb.
protected virtual void OnThumbDragCompleted(VectorEventArgs e)
Parameters
OnThumbDragStarted(VectorEventArgs)
Called when user start dragging the Thumb.
protected virtual void OnThumbDragStarted(VectorEventArgs e)
Parameters
UpdateDataValidation(AvaloniaProperty, BindingValueType, Exception?)
Called to update the validation state for properties for which data validation is enabled.
protected override void UpdateDataValidation(AvaloniaProperty property, BindingValueType state, Exception? error)
Parameters
property
AvaloniaPropertyThe property.
state
BindingValueTypeThe current data binding state.
error
ExceptionThe current data binding error, if any.