public sealed class ScrollBarThe bar down the side of a ScrollView.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
A real element rather than something the scroll view draws, for one reason: it has to be drawn over the content, and OnDraw runs before an element's children. A later sibling is painted last, which is exactly where a scrollbar belongs.
It draws its own thumb rather than holding one, for the reason every other control in this set that draws itself does: the thumb's length and position are fractions of a viewport that only exists after layout, and writing them back as offsets would settle a frame late on every scroll — which is the one frame anybody is looking at.
Fields and properties (11)
protected override string TagNameThe element name this type answers to when a caller does not choose one.
protected override bool AcceptsFocusWhether the focus can rest on this kind of control at all.
public Orientation Orientationpublic float Valuepublic float ViewportSizepublic float ContentSizepublic float RangeHow far it can travel.
public static readonly UiPropertyKey OrientationPropertyIdentity for Orientation.
public static readonly UiPropertyKey ValuePropertyIdentity for Value.
public static readonly UiPropertyKey ViewportSizePropertyIdentity for ViewportSize.
public static readonly UiPropertyKey ContentSizePropertyIdentity for ContentSize.
Events (1)
public Action<ScrollBar, float>? ScrolledRaised when a drag on the thumb moves it.
Methods (6)
protected override void OnCreated()Builds whatever this element is made of, once, as it joins a document.
protected override void OnDraw(DrawContext context)Draws whatever this element is, beyond what a stylesheet can describe.
public void ClearOrientation()Unsets Orientation, so it takes its default or its ancestor's value again.
public void ClearValue()Unsets Value, so it takes its default or its ancestor's value again.
public void ClearViewportSize()Unsets ViewportSize, so it takes its default or its ancestor's value again.
public void ClearContentSize()Unsets ContentSize, so it takes its default or its ancestor's value again.
Used by (2)
- NavigationInteractionTestsVixen.Ui.Controls.Tests
- ScrollViewVixen.Ui.Controls