Class Slider
Represents a control that lets the user select from a range of values by moving a Thumb control along a track.
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
[TemplatePart(Name = "HorizontalTemplate", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "HorizontalTrackLargeChangeIncreaseRepeatButton", Type = typeof(RepeatButton))]
[TemplatePart(Name = "HorizontalTrackLargeChangeDecreaseRepeatButton", Type = typeof(RepeatButton))]
[TemplatePart(Name = "HorizontalThumb", Type = typeof(Thumb))]
[TemplatePart(Name = "VerticalTemplate", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "VerticalTrackLargeChangeIncreaseRepeatButton", Type = typeof(RepeatButton))]
[TemplatePart(Name = "VerticalTrackLargeChangeDecreaseRepeatButton", Type = typeof(RepeatButton))]
[TemplatePart(Name = "VerticalThumb", Type = typeof(Thumb))]
public class Slider : RangeBase, IControl, IFrameworkElement, IUIElement, IDependencyObject
Constructors
| Improve this Doc View SourceSlider()
Initializes a new instance of the Slider class.
Declaration
public Slider()
Fields
| Improve this Doc View SourceIsDirectionReversedProperty
Identifies the IsDirectionReversed dependency property.
Declaration
public static readonly DependencyProperty IsDirectionReversedProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsFocusedProperty
Identifies the IsFocused dependency property.
Declaration
public static readonly DependencyProperty IsFocusedProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
OrientationProperty
Identifies the Orientation dependency property.
Declaration
public static readonly DependencyProperty OrientationProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceIsDirectionReversed
Gets or sets a value that indicates the direction of increasing value.
Declaration
public bool IsDirectionReversed { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | 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. |
IsFocused
Gets a value indicating whether the slider control has focus.
Declaration
public bool IsFocused { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the slider control has focus; otherwise, false. The default is false. |
Orientation
Gets or sets the orientation of a Slider.
Declaration
public Orientation Orientation { get; set; }
Property Value
Type | Description |
---|---|
Orientation | One of the Orientation values. The default is Horizontal. |
Methods
| Improve this Doc View SourceOnApplyTemplate()
Builds the visual tree for the Slider control when a new template is applied.
Declaration
public override void OnApplyTemplate()
Overrides
| Improve this Doc View SourceOnCreateAutomationPeer()
Returns a SliderAutomationPeer object for use by the automation infrastructure.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
Type | Description |
---|---|
AutomationPeer | A SliderAutomationPeer object for use by the slider control. |
Overrides
| Improve this Doc View SourceOnGotFocus(RoutedEventArgs)
Provides class handling for the GotFocus event.
Declaration
protected override void OnGotFocus(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
RoutedEventArgs | e | A RoutedEventArgs that contains the event data. |
Overrides
| Improve this Doc View SourceOnKeyDown(KeyEventArgs)
Provides class handling for the KeyDown event.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
KeyEventArgs | e | A KeyEventArgs that contains the event data. |
Overrides
| Improve this Doc View SourceOnLostFocus(RoutedEventArgs)
Provides class handling for the LostFocus event.
Declaration
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
RoutedEventArgs | e | A RoutedEventArgs that contains the event data. |
Overrides
| Improve this Doc View SourceOnMaximumChanged(Double, Double)
Called when the Maximum property changes.
Declaration
protected override void OnMaximumChanged(double oldMaximum, double newMaximum)
Parameters
Type | Name | Description |
---|---|---|
System.Double | oldMaximum | Old value of the Maximum property. |
System.Double | newMaximum | New value of the Maximum property. |
Overrides
| Improve this Doc View SourceOnMinimumChanged(Double, Double)
Called when the Minimum property changes.
Declaration
protected override void OnMinimumChanged(double oldMinimum, double newMinimum)
Parameters
Type | Name | Description |
---|---|---|
System.Double | oldMinimum | Old value of the Minimum property. |
System.Double | newMinimum | New value of the Minimum property. |
Overrides
| Improve this Doc View SourceOnMouseEnter(MouseEventArgs)
Provides class handling MouseEnter event.
Declaration
protected override void OnMouseEnter(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseEventArgs | e | A MouseEventArgs that contains the event data. |
Overrides
| Improve this Doc View SourceOnMouseLeave(MouseEventArgs)
Provides class handling for the MouseLeave event.
Declaration
protected override void OnMouseLeave(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseEventArgs | e | A MouseEventArgs that contains the event data. |
Overrides
| Improve this Doc View SourceOnMouseLeftButtonDown(MouseButtonEventArgs)
Provides class handling for the MouseLeftButtonDown event.
Declaration
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseButtonEventArgs | e |
Overrides
| Improve this Doc View SourceOnMouseLeftButtonUp(MouseButtonEventArgs)
Responds to the MouseLeftButtonUp event.
Declaration
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseButtonEventArgs | e | The event data for the MouseLeftButtonUp event. |
Overrides
| Improve this Doc View SourceOnValueChanged(Double, Double)
Declaration
protected override void OnValueChanged(double oldValue, double newValue)
Parameters
Type | Name | Description |
---|---|---|
System.Double | oldValue | |
System.Double | newValue |