Class ScrollBar
Represents a control that provides a scroll bar that has a sliding Thumb whose position corresponds to a value.
Inherited Members
Namespace: System.Windows.Controls.Primitives
Assembly: OpenSilver.dll
Syntax
[TemplatePart(Name = "HorizontalRoot", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "HorizontalLargeIncrease", Type = typeof(RepeatButton))]
[TemplatePart(Name = "HorizontalLargeDecrease", Type = typeof(RepeatButton))]
[TemplatePart(Name = "HorizontalSmallDecrease", Type = typeof(RepeatButton))]
[TemplatePart(Name = "HorizontalSmallIncrease", Type = typeof(RepeatButton))]
[TemplatePart(Name = "HorizontalThumb", Type = typeof(Thumb))]
[TemplatePart(Name = "VerticalRoot", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "VerticalLargeIncrease", Type = typeof(RepeatButton))]
[TemplatePart(Name = "VerticalLargeDecrease", Type = typeof(RepeatButton))]
[TemplatePart(Name = "VerticalSmallIncrease", Type = typeof(RepeatButton))]
[TemplatePart(Name = "VerticalSmallDecrease", Type = typeof(RepeatButton))]
[TemplatePart(Name = "VerticalThumb", Type = typeof(Thumb))]
public sealed class ScrollBar : RangeBase, IControl, IFrameworkElement, IUIElement, IDependencyObject
Constructors
| Improve this Doc View SourceScrollBar()
Initializes a new instance of the ScrollBar class.
Declaration
public ScrollBar()
Fields
| Improve this Doc View SourceDebounceProperty
Declaration
public static readonly DependencyProperty DebounceProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
OrientationProperty
Identifies the Orientation dependency property.
Declaration
public static readonly DependencyProperty OrientationProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ViewportSizeProperty
Identifies the ViewportSize dependency property.
Declaration
public static readonly DependencyProperty ViewportSizeProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceDebounce
Declaration
public TimeSpan Debounce { get; set; }
Property Value
Type | Description |
---|---|
System.TimeSpan |
Orientation
Gets or sets whether the ScrollBar is displayed horizontally or vertically.
Declaration
public Orientation Orientation { get; set; }
Property Value
Type | Description |
---|---|
Orientation | An Orientation enumeration value that defines whether the ScrollBar is displayed horizontally or vertically. The default is Horizontal. |
ViewportSize
Gets or sets the amount of the scrollable content that is currently visible.
Declaration
public double ViewportSize { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The amount of the scrollable content that is currently visible. The default is 0. |
Methods
| Improve this Doc View SourceGetDebounce(FrameworkElement)
Declaration
public static TimeSpan GetDebounce(FrameworkElement fe)
Parameters
Type | Name | Description |
---|---|---|
FrameworkElement | fe |
Returns
Type | Description |
---|---|
System.TimeSpan |
OnApplyTemplate()
Builds the visual tree for the ScrollBar control when a new template is applied.
Declaration
public override void OnApplyTemplate()
Overrides
| Improve this Doc View SourceOnCreateAutomationPeer()
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
Type | Description |
---|---|
AutomationPeer |
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)
Responds to the MouseEnter event.
Declaration
protected override void OnMouseEnter(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseEventArgs | e | The event data for the MouseEnter event. |
Overrides
| Improve this Doc View SourceOnMouseLeave(MouseEventArgs)
Responds to the MouseLeave event.
Declaration
protected override void OnMouseLeave(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseEventArgs | e | The event data for the MouseLeave event. |
Overrides
| Improve this Doc View SourceOnMouseLeftButtonDown(MouseButtonEventArgs)
Responds to the MouseLeftButtonDown event.
Declaration
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseButtonEventArgs | e | The event data for the MouseLeftButtonDown event. |
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)
Called when the Value property changes.
Declaration
protected override void OnValueChanged(double oldValue, double newValue)
Parameters
Type | Name | Description |
---|---|---|
System.Double | oldValue | Old value of the Value property. |
System.Double | newValue | New value of the Value property. |
Overrides
| Improve this Doc View SourceSetDebounce(FrameworkElement, TimeSpan)
Declaration
public static void SetDebounce(FrameworkElement fe, TimeSpan debounce)
Parameters
Type | Name | Description |
---|---|---|
FrameworkElement | fe | |
System.TimeSpan | debounce |
Events
| Improve this Doc View SourceScroll
Occurs one or more times as content scrolls in a ScrollBar when the user moves the Thumb by using the mouse.
Declaration
public event ScrollEventHandler Scroll
Event Type
Type | Description |
---|---|
ScrollEventHandler |