Table of Contents

Class SkiaScroll

Namespace
DrawnUi.Draw
Assembly
DrawnUi.Maui.dll
[ContentProperty("Content")]
public class SkiaScroll : SkiaControl, INotifyPropertyChanged, IEffectControlProvider, IToolTipElement, IContextFlyoutElement, IAnimatable, IVisualElementController, IElementController, IView, ITransform, IElement, IVisualTreeElement, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, IHasAfterEffects, ISkiaControl, IDrawnBase, ICanBeUpdatedWithContext, ICanBeUpdated, ISkiaDisposable, IDisposable, ISkiaGestureListener, IDefinesViewport, IWithContent
Inheritance
SkiaScroll
Implements
Derived
Inherited Members
Extension Methods

Constructors

SkiaScroll()

public SkiaScroll()

Fields

AdaptToKeyboardForProperty

public static readonly BindableProperty AdaptToKeyboardForProperty

Field Value

BindableProperty

AdaptToKeyboardSizeProperty

public static readonly BindableProperty AdaptToKeyboardSizeProperty

Field Value

BindableProperty

AutoScrollingSpeedMsProperty

public static readonly BindableProperty AutoScrollingSpeedMsProperty

Field Value

BindableProperty

BouncesProperty

ToDo adapt this to same logic as ScrollLooped has !

public static readonly BindableProperty BouncesProperty

Field Value

BindableProperty

CanScrollUsingHeaderProperty

public static readonly BindableProperty CanScrollUsingHeaderProperty

Field Value

BindableProperty

ChangeDistancePannedProperty

public static readonly BindableProperty ChangeDistancePannedProperty

Field Value

BindableProperty

ChangeVelocityScrolledProperty

public static readonly BindableProperty ChangeVelocityScrolledProperty

Field Value

BindableProperty

ContentGesturesHit

protected bool ContentGesturesHit

Field Value

bool

ContentOffsetProperty

public static readonly BindableProperty ContentOffsetProperty

Field Value

BindableProperty

ContentProperty

public static readonly BindableProperty ContentProperty

Field Value

BindableProperty

DetectIndexChildAt

protected SKPoint DetectIndexChildAt

Field Value

SKPoint

DetectIndexChildEndAt

protected SKPoint DetectIndexChildEndAt

Field Value

SKPoint

DetectIndexChildStartAt

protected SKPoint DetectIndexChildStartAt

Field Value

SKPoint

Elastic

public static int Elastic

Field Value

int

FooterProperty

public static readonly BindableProperty FooterProperty

Field Value

BindableProperty

FooterSize

protected ScaledSize FooterSize

Field Value

ScaledSize

FrictionScrolledProperty

public static readonly BindableProperty FrictionScrolledProperty

Field Value

BindableProperty

HeaderBehindProperty

public static readonly BindableProperty HeaderBehindProperty

Field Value

BindableProperty

HeaderParallaxRatioProperty

public static readonly BindableProperty HeaderParallaxRatioProperty

Field Value

BindableProperty

HeaderProperty

public static readonly BindableProperty HeaderProperty

Field Value

BindableProperty

HeaderSize

protected ScaledSize HeaderSize

Field Value

ScaledSize

HeaderStickyProperty

public static readonly BindableProperty HeaderStickyProperty

Field Value

BindableProperty

IgnoreWrongDirectionProperty

public static readonly BindableProperty IgnoreWrongDirectionProperty

Field Value

BindableProperty

InContact

protected bool InContact

Field Value

bool

IsRefreshingProperty

public static readonly BindableProperty IsRefreshingProperty

Field Value

BindableProperty

LastContentSizePixels

protected SKSize LastContentSizePixels

Field Value

SKSize

LastMeasuredSizePixels

protected SKSize LastMeasuredSizePixels

Field Value

SKSize

LoadMoreCommandProperty

public static readonly BindableProperty LoadMoreCommandProperty

Field Value

BindableProperty

LoadMoreOffsetProperty

public static readonly BindableProperty LoadMoreOffsetProperty

Field Value

BindableProperty

LockGesturesUntilDown

protected bool LockGesturesUntilDown

Field Value

bool

MaxBounceVelocityProperty

public static readonly BindableProperty MaxBounceVelocityProperty

Field Value

BindableProperty

MaxVelocityProperty

public static readonly BindableProperty MaxVelocityProperty

Field Value

BindableProperty

OrderedScrollIsAnimatedProperty

public static readonly BindableProperty OrderedScrollIsAnimatedProperty

Field Value

BindableProperty

OrderedScrollProperty

public static readonly BindableProperty OrderedScrollProperty

Field Value

BindableProperty

OrderedScrollTo

We might order a scroll before the control was drawn, so it's a kind of startup position saved every time one calls ScrollTo

protected ScrollToPointOrder OrderedScrollTo

Field Value

ScrollToPointOrder

OrderedScrollToIndex

We might order a scroll before the control was drawn, so it's a kind of startup position saved every time one calls ScrollToIndex

protected ScrollToIndexOrder OrderedScrollToIndex

Field Value

ScrollToIndexOrder

OrientationProperty

public static readonly BindableProperty OrientationProperty

Field Value

BindableProperty

ParallaxOverscrollEnabledProperty

public static readonly BindableProperty ParallaxOverscrollEnabledProperty

Field Value

BindableProperty

PlaneBlue

public const string PlaneBlue = "Blue"

Field Value

string

PlaneGreen

public const string PlaneGreen = "Greeen"

Field Value

string

PlaneRed

public const string PlaneRed = "Red"

Field Value

string

RefreshCommandProperty

public static readonly BindableProperty RefreshCommandProperty

Field Value

BindableProperty

RefreshDistanceLimitProperty

public static readonly BindableProperty RefreshDistanceLimitProperty

Field Value

BindableProperty

RefreshEnabledProperty

public static readonly BindableProperty RefreshEnabledProperty

Field Value

BindableProperty

RefreshIndicatorProperty

public static readonly BindableProperty RefreshIndicatorProperty

Field Value

BindableProperty

RefreshShowDistanceProperty

public static readonly BindableProperty RefreshShowDistanceProperty

Field Value

BindableProperty

ResetScrollPositionOnContentSizeChangedProperty

public static readonly BindableProperty ResetScrollPositionOnContentSizeChangedProperty

Field Value

BindableProperty

RespondsToGesturesProperty

public static readonly BindableProperty RespondsToGesturesProperty

Field Value

BindableProperty

RubberDampingProperty

public static readonly BindableProperty RubberDampingProperty

Field Value

BindableProperty

RubberEffectProperty

public static readonly BindableProperty RubberEffectProperty

Field Value

BindableProperty

ScrollTypeProperty

public static readonly BindableProperty ScrollTypeProperty

Field Value

BindableProperty

ScrollVelocityThreshold

To filter micro-gestures while manually panning

public static float ScrollVelocityThreshold

Field Value

float

ScrollingEasing

public Easing ScrollingEasing

Field Value

Easing

ScrollingSpeedMsProperty

public static readonly BindableProperty ScrollingSpeedMsProperty

Field Value

BindableProperty

SnapBouncingIfVelocityLessThanProperty

public static readonly BindableProperty SnapBouncingIfVelocityLessThanProperty

Field Value

BindableProperty

SnapToChildrenProperty

public static readonly BindableProperty SnapToChildrenProperty

Field Value

BindableProperty

SystemAnimationTimeSecs

Time for the snapping animations as well as the scroll to top etc animations..

public static float SystemAnimationTimeSecs

Field Value

float

ThesholdSwipeOnUp

Min velocity in points/sec to flee/swipe when finger is up

public static float ThesholdSwipeOnUp

Field Value

float

TrackIndexPositionOffsetProperty

public static readonly BindableProperty TrackIndexPositionOffsetProperty

Field Value

BindableProperty

TrackIndexPositionProperty

public static readonly BindableProperty TrackIndexPositionProperty

Field Value

BindableProperty

VelocityImageLoaderLockProperty

public static readonly BindableProperty VelocityImageLoaderLockProperty

Field Value

BindableProperty

VelocityTrackerPan

protected VelocityTracker VelocityTrackerPan

Field Value

VelocityTracker

VelocityTrackerScale

protected VelocityTracker VelocityTrackerScale

Field Value

VelocityTracker

ViewportZoomProperty

public static readonly BindableProperty ViewportZoomProperty

Field Value

BindableProperty

WheelLineSize

How many points (not pixels) we want to scroll for 1 wheel line

public static float WheelLineSize

Field Value

float

ZoomLockedProperty

public static readonly BindableProperty ZoomLockedProperty

Field Value

BindableProperty

ZoomMaxProperty

public static readonly BindableProperty ZoomMaxProperty

Field Value

BindableProperty

ZoomMinProperty

public static readonly BindableProperty ZoomMinProperty

Field Value

BindableProperty

_animatorFlingX

Fling with deceleration

protected ScrollFlingAnimator _animatorFlingX

Field Value

ScrollFlingAnimator

_animatorFlingY

Fling with deceleration

protected ScrollFlingAnimator _animatorFlingY

Field Value

ScrollFlingAnimator

_minVelocity

protected double _minVelocity

Field Value

double

_minVelocitySnap

protected float _minVelocitySnap

Field Value

float

_pannedOffset

protected Vector2 _pannedOffset

Field Value

Vector2

_pannedVelocity

protected Vector2 _pannedVelocity

Field Value

Vector2

_pannedVelocityRemaining

protected Vector2 _pannedVelocityRemaining

Field Value

Vector2

_panningCurrentOffsetPts

protected Vector2 _panningCurrentOffsetPts

Field Value

Vector2

_panningLastDelta

protected Vector2 _panningLastDelta

Field Value

Vector2

_planeHeight

protected int _planeHeight

Field Value

int

_planePrepareThreshold

protected int _planePrepareThreshold

Field Value

int

_planeWidth

protected int _planeWidth

Field Value

int

_scrollMaxX

protected float _scrollMaxX

Field Value

float

_scrollMaxY

protected float _scrollMaxY

Field Value

float

_scrollMinX

Units

protected float _scrollMinX

Field Value

float

_scrollMinY

Units

protected float _scrollMinY

Field Value

float

_scrollerX

Direct scroller for ordered scroll, snap etc

protected RangeAnimator _scrollerX

Field Value

RangeAnimator

_scrollerY

Direct scroller for ordered scroll, snap etc

protected RangeAnimator _scrollerY

Field Value

RangeAnimator

_vectorAnimatorBounceX

protected SpringWithVelocityAnimator _vectorAnimatorBounceX

Field Value

SpringWithVelocityAnimator

_vectorAnimatorBounceY

protected SpringWithVelocityAnimator _vectorAnimatorBounceY

Field Value

SpringWithVelocityAnimator

_velocitySwipe

protected float _velocitySwipe

Field Value

float

_velocitySwipeRatio

protected float _velocitySwipeRatio

Field Value

float

_viewportOffsetX

protected float _viewportOffsetX

Field Value

float

_viewportOffsetY

protected float _viewportOffsetY

Field Value

float

ptsContentHeight

protected float ptsContentHeight

Field Value

float

ptsContentWidth

protected float ptsContentWidth

Field Value

float

snapMinimumVelocity

POINTS per sec

protected float snapMinimumVelocity

Field Value

float

Properties

AdaptToKeyboardFor

public SkiaControl AdaptToKeyboardFor { get; set; }

Property Value

SkiaControl

AdaptToKeyboardSize

public double AdaptToKeyboardSize { get; set; }

Property Value

double

AutoScrollingSpeedMs

For snap and ordered scrolling

public int AutoScrollingSpeedMs { get; set; }

Property Value

int

Bounces

Should the scroll bounce at edges. Set to false if you want this scroll to let the parent SkiaDrawer respond to scroll when the child scroll reached bounds.

public bool Bounces { get; set; }

Property Value

bool

CanScrollUsingHeader

If disabled will not scroll using gestures. Scrolling will still be possible by code.

public bool CanScrollUsingHeader { get; set; }

Property Value

bool

ChangeDistancePanned

For when the finger is down and panning

public float ChangeDistancePanned { get; set; }

Property Value

float

ChangeVelocityScrolled

For when the finger is up and swipe is detected

public float ChangeVelocityScrolled { get; set; }

Property Value

float

ChildWasPanning

protected bool ChildWasPanning { get; set; }

Property Value

bool

ChildWasTapped

protected bool ChildWasTapped { get; set; }

Property Value

bool

Content

public SkiaControl Content { get; set; }

Property Value

SkiaControl

ContentAvailableSpace

public SKRect ContentAvailableSpace { get; protected set; }

Property Value

SKRect

ContentOffset

public double ContentOffset { get; set; }

Property Value

double

ContentOffsetBounds

There are the bounds the scroll offset can go to.. This is NOT the bounds for the whole content.

protected SKRect ContentOffsetBounds { get; set; }

Property Value

SKRect

ContentRectWithOffset

The viewport for content

public ScaledRect ContentRectWithOffset { get; protected set; }

Property Value

ScaledRect

ContentViewport

public ScaledRect ContentViewport { get; protected set; }

Property Value

ScaledRect

CurrentIndex

public int CurrentIndex { get; protected set; }

Property Value

int

CurrentIndexHit

public ContainsPointResult CurrentIndexHit { get; set; }

Property Value

ContainsPointResult

DecelerationRatio

public float DecelerationRatio { get; set; }

Property Value

float

FirstVisibleIndex

public int FirstVisibleIndex { get; set; }

Property Value

int
public SkiaControl Footer { get; set; }

Property Value

SkiaControl

FrictionScrolled

Use this to control how fast the scroll will decelerate. Values 0.1 - 0.9 are the best, default is 0.3. Usually you would set higher friction for ScrollView-like scrolls and much lower for CollectionView-like scrolls (0.1 or 0.2). For a picker: 05 - 0.9.

public float FrictionScrolled { get; set; }

Property Value

float

HadDown

public bool HadDown { get; protected set; }

Property Value

bool

HasContentToScroll

public bool HasContentToScroll { get; set; }

Property Value

bool

Header

public SkiaControl Header { get; set; }

Property Value

SkiaControl

HeaderBehind

public bool HeaderBehind { get; set; }

Property Value

bool

HeaderParallaxRatio

public double HeaderParallaxRatio { get; set; }

Property Value

double

HeaderSticky

Should the header stay in place when content is scrolling

public bool HeaderSticky { get; set; }

Property Value

bool

IgnoreWrongDirection

Will ignore gestures of the wrong direction, like if this Orientation is Horizontal will ignore gestures with vertical direction velocity. Default is False.

public bool IgnoreWrongDirection { get; set; }

Property Value

bool

IncrementalMeasureAheadCount

protected virtual int IncrementalMeasureAheadCount { get; set; }

Property Value

int

IncrementalMeasureBatchSize

protected virtual int IncrementalMeasureBatchSize { get; set; }

Property Value

int

InteractionState

public ScrollInteractionState InteractionState { get; set; }

Property Value

ScrollInteractionState

InternalRefreshIndicator

protected IRefreshIndicator InternalRefreshIndicator { get; set; }

Property Value

IRefreshIndicator

InternalViewportOffset

This is where the view port is actually is after being scrolled. We used this value to offset viewport on drawing the last frame

public ScaledPoint InternalViewportOffset { get; protected set; }

Property Value

ScaledPoint

IsAnimating

public bool IsAnimating { get; set; }

Property Value

bool

IsBouncing

public bool IsBouncing { get; set; }

Property Value

bool

IsContentActive

protected virtual bool IsContentActive { get; }

Property Value

bool

IsRefreshing

public bool IsRefreshing { get; set; }

Property Value

bool

IsScrolling

public bool IsScrolling { get; set; }

Property Value

bool

IsSnapping

public bool IsSnapping { get; set; }

Property Value

bool

IsUserFocused

public bool IsUserFocused { get; protected set; }

Property Value

bool

IsUserPanning

public bool IsUserPanning { get; protected set; }

Property Value

bool

IsViewportReady

public bool IsViewportReady { get; protected set; }

Property Value

bool

LastVisibleIndex

public int LastVisibleIndex { get; set; }

Property Value

int

LoadMoreCommand

public ICommand LoadMoreCommand { get; set; }

Property Value

ICommand

LoadMoreOffset

public float LoadMoreOffset { get; set; }

Property Value

float

MaxBounceVelocity

Limit bounce velocity

public float MaxBounceVelocity { get; set; }

Property Value

float

MaxVelocity

Limit user input velocity

public float MaxVelocity { get; set; }

Property Value

float

MeasurementTriggerDistance

protected virtual double MeasurementTriggerDistance { get; set; }

Property Value

double

NeedMeasure

public override bool NeedMeasure { get; set; }

Property Value

bool

OrderedScroll

public int OrderedScroll { get; set; }

Property Value

int

OrderedScrollIsAnimated

public bool OrderedScrollIsAnimated { get; set; }

Property Value

bool

Orientation

Gets or sets the scrolling direction of the ScrollView. This is a bindable property.
public ScrollOrientation Orientation { get; set; }

Property Value

ScrollOrientation

OverScrolled

public bool OverScrolled { get; }

Property Value

bool

OverscrollDistance

Units

public Vector2 OverscrollDistance { get; set; }

Property Value

Vector2

ParallaxComputedValue

public double ParallaxComputedValue { get; set; }

Property Value

double

ParallaxOverscrollEnabled

public bool ParallaxOverscrollEnabled { get; set; }

Property Value

bool

PlaneBackward

protected Plane PlaneBackward { get; set; }

Property Value

Plane

PlaneCurrent

protected Plane PlaneCurrent { get; set; }

Property Value

Plane

PlaneForward

protected Plane PlaneForward { get; set; }

Property Value

Plane

RefreshCommand

public ICommand RefreshCommand { get; set; }

Property Value

ICommand

RefreshDistanceLimit

Applyed to RefreshView

public float RefreshDistanceLimit { get; set; }

Property Value

float

RefreshEnabled

public bool RefreshEnabled { get; set; }

Property Value

bool

RefreshIndicator

public IRefreshIndicator RefreshIndicator { get; set; }

Property Value

IRefreshIndicator

RefreshShowDistance

Applyed to RefreshView, distance in points where the refresh view will stop moving and stay here animating

public float RefreshShowDistance { get; set; }

Property Value

float

ResetScrollPositionOnContentSizeChanged

public bool ResetScrollPositionOnContentSizeChanged { get; set; }

Property Value

bool

RespondsToGestures

If disabled will not scroll using gestures. Scrolling will still be possible by code.

public bool RespondsToGestures { get; set; }

Property Value

bool

ReverseGestures

public bool ReverseGestures { get; set; }

Property Value

bool

RubberDamping

If Bounce is enabled this basically controls how less the scroll will bounce when displaced from limit by finger or inertia. Default is 0.55.

public double RubberDamping { get; set; }

Property Value

double

RubberEffect

If Bounce is enabled this basically controls how far from the limit can the scroll be elastically offset by finger or inertia. Default is 0.55.

public double RubberEffect { get; set; }

Property Value

double

ScrollLocked

public bool ScrollLocked { get; set; }

Property Value

bool

ScrollProgressX

0.0 - 1.0

public double ScrollProgressX { get; }

Property Value

double

ScrollProgressY

0.0 - 1.0

public double ScrollProgressY { get; }

Property Value

double

ScrollType

Gets or sets the scrolling direction of the ScrollView. This is a bindable property.
public ViewportScrollType ScrollType { get; set; }

Property Value

ViewportScrollType

ScrollingDirection

public LinearDirectionType ScrollingDirection { get; protected set; }

Property Value

LinearDirectionType

ScrollingSpeedMs

Used by range scroller (ScrollToX, ScrollToY)

public int ScrollingSpeedMs { get; set; }

Property Value

int

SnapBouncingIfVelocityLessThan

public float SnapBouncingIfVelocityLessThan { get; set; }

Property Value

float

SnapToChildren

Whether should snap to children after scrolling stopped

public SnapToChildrenType SnapToChildren { get; set; }

Property Value

SnapToChildrenType

Snapped

public bool Snapped { get; set; }

Property Value

bool

SwipeVelocityAccumulator

protected VelocityAccumulator SwipeVelocityAccumulator { get; }

Property Value

VelocityAccumulator

TrackIndexPosition

The position in viewport you want to track for content layout child index

public RelativePositionType TrackIndexPosition { get; set; }

Property Value

RelativePositionType

TrackIndexPositionOffset

public float TrackIndexPositionOffset { get; set; }

Property Value

float

UseVirtual

public virtual bool UseVirtual { get; }

Property Value

bool

UsesRenderingTree

public override bool UsesRenderingTree { get; }

Property Value

bool

UsingRefreshDistanceLimit

protected double UsingRefreshDistanceLimit { get; }

Property Value

double

VelocityImageLoaderLock

Range at which the image loader will stop or resume loading images while scrolling

public double VelocityImageLoaderLock { get; set; }

Property Value

double

VelocityX

public float VelocityX { get; set; }

Property Value

float

VelocityY

public float VelocityY { get; set; }

Property Value

float

Viewport

public ScaledRect Viewport { get; protected set; }

Property Value

ScaledRect

ViewportOffsetX

public float ViewportOffsetX { get; set; }

Property Value

float

ViewportOffsetY

public float ViewportOffsetY { get; set; }

Property Value

float

ViewportZoom

public double ViewportZoom { get; set; }

Property Value

double

WasSwiping

Had no panning just down+up with velocity more than threshold

protected bool WasSwiping { get; set; }

Property Value

bool

WillClipBounds

Used to check whether to apply IsClippedToBounds property

public override bool WillClipBounds { get; }

Property Value

bool

ZoomLocked

public bool ZoomLocked { get; set; }

Property Value

bool

ZoomMax

public double ZoomMax { get; set; }

Property Value

double

ZoomMin

public double ZoomMin { get; set; }

Property Value

double

ZoomScaleInternal

We might have difference between pinch scale and manually set zoom.

protected double ZoomScaleInternal { get; set; }

Property Value

double

Methods

AdaptToKeyboard()

public virtual void AdaptToKeyboard()

AdjustCache()

protected void AdjustCache()

AdjustHeaderParallax()

protected virtual void AdjustHeaderParallax()

ApplyBindingContext()

public override void ApplyBindingContext()

ApplyContentSize()

protected virtual void ApplyContentSize()

ApplyPannedOffsetWithVelocity(SkiaDrawingContext)

Applies panning on draw every frame, to be able to smoothly animate frames between panning changes.

protected virtual void ApplyPannedOffsetWithVelocity(SkiaDrawingContext ctx)

Parameters

ctx SkiaDrawingContext

ApplyScrollPositionToRefreshViewUnsafe()

protected virtual void ApplyScrollPositionToRefreshViewUnsafe()

BounceIfNeeded(ScrollFlingAnimator)

protected virtual void BounceIfNeeded(ScrollFlingAnimator animator)

Parameters

animator ScrollFlingAnimator

CalculateNeededScrollForKeyboard()

public void CalculateNeededScrollForKeyboard()

CalculateOverscrollDistance(float, float)

In POINTS not pixels!!!

public Vector2 CalculateOverscrollDistance(float x, float y)

Parameters

x float
y float

Returns

Vector2

CalculateScrollOffsetForIndex(int, RelativePositionType)

ToDo this actually work only for Stack and Row

public virtual SKPoint CalculateScrollOffsetForIndex(int index, RelativePositionType option)

Parameters

index int
option RelativePositionType

Returns

SKPoint

CalculateViewportForPlane(Plane, SKPoint)

Calculate the specific viewport area this plane should render

protected virtual SKRect CalculateViewportForPlane(Plane plane, SKPoint offsetToUse)

Parameters

plane Plane
offsetToUse SKPoint

Returns

SKRect

CalculateVisibleIndex(RelativePositionType)

Calculates CurrentIndex

public virtual ContainsPointResult CalculateVisibleIndex(RelativePositionType option)

Parameters

option RelativePositionType

Returns

ContainsPointResult

CalculateVisibleIndexes()

Will calculate first/last visible and current index, if tracked with TrackIndexPosition.

public virtual void CalculateVisibleIndexes()

CheckAndInvalidateDirtyPlanes()

Check dirty children and invalidate specific planes that contain them

protected virtual void CheckAndInvalidateDirtyPlanes()

CheckAndSetIsStillAnimating()

protected virtual void CheckAndSetIsStillAnimating()

CheckForIncrementalMeasurementTrigger()

protected bool? CheckForIncrementalMeasurementTrigger()

Returns

bool?

CheckNeedRefresh()

public virtual void CheckNeedRefresh()

CheckNeedToSnap()

protected virtual bool CheckNeedToSnap()

Returns

bool

ClampOffset(float, float, SKRect, bool)

public virtual Vector2 ClampOffset(float x, float y, SKRect contentOffsetBounds, bool strict = false)

Parameters

x float
y float
contentOffsetBounds SKRect
strict bool

Returns

Vector2

ClampOffsetHard(float, float)

"Just clamp". Currently used for wheel scroll.

protected virtual Vector2 ClampOffsetHard(float x, float y)

Parameters

x float
y float

Returns

Vector2

ClampOffsetWithRubberBand(float, float, SKRect)

Used to clamp while panning while finger is down

protected virtual Vector2 ClampOffsetWithRubberBand(float x, float y, SKRect contentOffsetBounds)

Parameters

x float
y float
contentOffsetBounds SKRect

Returns

Vector2

ClampedOrderedScrollOffset(SKPoint)

protected virtual SKPoint ClampedOrderedScrollOffset(SKPoint scrollTo)

Parameters

scrollTo SKPoint

Returns

SKPoint

ClosestPoint(SKRect, SKPoint)

public static SKPoint ClosestPoint(SKRect rect, SKPoint point)

Parameters

rect SKRect
point SKPoint

Returns

SKPoint

Draw(DrawingContext)

protected override void Draw(DrawingContext context)

Parameters

context DrawingContext

DrawViews(DrawingContext)

Base method will call RenderViewsList. Return number of drawn views.

protected override int DrawViews(DrawingContext context)

Parameters

context DrawingContext

Returns

int

DrawVirtual(DrawingContext)

This is called when scrolling changes when in UseVirtual mode, override this to draw custom content

public virtual void DrawVirtual(DrawingContext context)

Parameters

context DrawingContext

ExecuteDelayedScrollOrders()

public virtual void ExecuteDelayedScrollOrders()

ExecuteScrollToIndexOrder()

public bool ExecuteScrollToIndexOrder()

Returns

bool

ExecuteScrollToOrder()

public bool ExecuteScrollToOrder()

Returns

bool

FindPlaneContainingChild(SkiaControl)

Determines which plane contains the given child control by checking render trees

protected virtual Plane FindPlaneContainingChild(SkiaControl control)

Parameters

control SkiaControl

Returns

Plane

FlingAfterInitialized(ScrollFlingAnimator)

protected Task<bool> FlingAfterInitialized(ScrollFlingAnimator animator)

Parameters

animator ScrollFlingAnimator

Returns

Task<bool>

FlingFrom(ScrollFlingAnimator, float, float)

protected virtual Task<bool> FlingFrom(ScrollFlingAnimator animator, float from, float velocity)

Parameters

animator ScrollFlingAnimator
from float
velocity float

Returns

Task<bool>

FlingTo(ScrollFlingAnimator, float, float, float)

protected virtual Task<bool> FlingTo(ScrollFlingAnimator animator, float from, float to, float timeSeconds)

Parameters

animator ScrollFlingAnimator
from float
to float
timeSeconds float

Returns

Task<bool>

FlingToAuto(ScrollFlingAnimator, float, float, float)

protected virtual Task<bool> FlingToAuto(ScrollFlingAnimator animator, float from, float to, float changeSpeedSecs = 0)

Parameters

animator ScrollFlingAnimator
from float
to float
changeSpeedSecs float

Returns

Task<bool>

GetClosestSidePoint(SKPoint, SKRect, SKSize)

This uses whole viewport size, do not use this for snapping

public static SKPoint GetClosestSidePoint(SKPoint overscrollPoint, SKRect contentRect, SKSize viewportSize)

Parameters

overscrollPoint SKPoint
contentRect SKRect
viewportSize SKSize

Returns

SKPoint

GetContentAvailableRect(SKRect)

In PIXELS

protected virtual SKRect GetContentAvailableRect(SKRect destination)

Parameters

destination SKRect

Returns

SKRect

GetContentOffsetBounds()

There are the bounds the scroll offset can go to.. This is NOT the bounds for the whole content. In POINTS not pixels!!!

public virtual SKRect GetContentOffsetBounds()

Returns

SKRect

GetItemIndex(SkiaLayout, float, float, RelativePositionType)

public virtual ContainsPointResult GetItemIndex(SkiaLayout layout, float pixelsOffsetX, float pixelsOffsetY, RelativePositionType option)

Parameters

layout SkiaLayout
pixelsOffsetX float
pixelsOffsetY float
option RelativePositionType

Returns

ContainsPointResult

GetOnScreenVisibleArea(DrawingContext, Vector2)

For virtualization. For this method to be conditional we introduced the pixelsDestination parameter so that the Parent could return different visible areas upon context. Normally pass your current destination you are drawing into as this parameter.

public override ScaledRect GetOnScreenVisibleArea(DrawingContext context, Vector2 inflateByPixels = default)

Parameters

context DrawingContext
inflateByPixels Vector2

Returns

ScaledRect

GetPlaneById(string)

protected virtual Plane GetPlaneById(string planeId)

Parameters

planeId string

Returns

Plane

GetVisibleIndexes(SkiaLayout, float, float)

public virtual (ContainsPointResult Current, ContainsPointResult Start, ContainsPointResult End) GetVisibleIndexes(SkiaLayout layout, float pixelsOffsetX, float pixelsOffsetY)

Parameters

layout SkiaLayout
pixelsOffsetX float
pixelsOffsetY float

Returns

(ContainsPointResult Current, ContainsPointResult Start, ContainsPointResult End)

HasDirtyChildren()

protected virtual bool HasDirtyChildren()

Returns

bool

HideRefreshIndicator()

protected virtual void HideRefreshIndicator()

Init()

protected void Init()

InitializePlanes()

public virtual void InitializePlanes()

InitializeScroller(float)

protected virtual void InitializeScroller(float scale)

Parameters

scale float

InitializeViewport(float)

protected virtual void InitializeViewport(float scale)

Parameters

scale float

InvalidateInternal()

Soft invalidation, without requiring update. So next time we try to draw this one it will recalc everything.

public override void InvalidateInternal()

InvalidatePlanes()

protected virtual void InvalidatePlanes()

InvalidateViewport()

Indicated that wants to be re-measured without invalidating cache

public override void InvalidateViewport()

IsGestureForChild(ISkiaGestureListener, SKPoint)

public override bool IsGestureForChild(ISkiaGestureListener listener, SKPoint point)

Parameters

listener ISkiaGestureListener
point SKPoint

Returns

bool

IsGestureForChild(ISkiaGestureListener, float, float)

public override bool IsGestureForChild(ISkiaGestureListener listener, float x, float y)

Parameters

listener ISkiaGestureListener
x float
y float

Returns

bool

IsGestureForChild(SkiaControl, SkiaGesturesParameters)

public override bool IsGestureForChild(SkiaControl child, SkiaGesturesParameters args)

Parameters

child SkiaControl
args SkiaGesturesParameters

Returns

bool

IsGestureForChild(SkiaControlWithRect, SKPoint)

public override bool IsGestureForChild(SkiaControlWithRect child, SKPoint point)

Parameters

child SkiaControlWithRect
point SKPoint

Returns

bool

IsGestureInPlane(Plane, PointF)

Check if gesture point intersects with plane's visible area

protected virtual bool IsGestureInPlane(Plane plane, PointF location)

Parameters

plane Plane
location PointF

Returns

bool

MeasureContent(float, float, float)

Calculate the value that will be set to ContentSize after that

protected virtual ScaledSize MeasureContent(float width, float height, float scale)

Parameters

width float
height float
scale float

Returns

ScaledSize

MeasureInternal(MeasureRequest)

protected override ScaledSize MeasureInternal(MeasureRequest request)

Parameters

request MeasureRequest

Returns

ScaledSize

MoveToX(float)

public virtual void MoveToX(float value)

Parameters

value float

MoveToY(float)

public virtual void MoveToY(float value)

Parameters

value float

OffsetOk(Vector2)

Whether the scrolling offset in inside scrollable bounds or not

protected virtual bool OffsetOk(Vector2 offset)

Parameters

offset Vector2

Returns

bool

OnDrawn(DrawingContext)

protected virtual void OnDrawn(DrawingContext context)

Parameters

context DrawingContext

OnLayoutReady()

Layout was changed with dimensions above zero. Rather a helper method, can you more generic OnLayoutChanged().

protected override void OnLayoutReady()

OnMeasured()

protected override void OnMeasured()

OnPropertyChanged(string)

Method that is called when a bound property is changed.

protected override void OnPropertyChanged(string propertyName = "")

Parameters

propertyName string

The name of the bound property that changed.

OnScrollCompleted()

This triggers smapping checks and actions

protected virtual void OnScrollCompleted()

OnScrolled()

Notify current scroll offset to some dependent views.

public virtual void OnScrolled()

OnScrolledForPlanes()

Viewport scrolled

protected virtual void OnScrolledForPlanes()

OnScrollerStarted()

protected virtual void OnScrollerStarted()

OnScrollerStopped()

protected virtual void OnScrollerStopped()

OnScrollerUpdated()

protected virtual void OnScrollerUpdated()

OnScrollingStateChanged(bool)

public virtual void OnScrollingStateChanged(bool value)

Parameters

value bool

OnWillDisposeWithChildren()

The OnDisposing might come with a delay to avoid disposing resources at use. This method will be called without delay when Dispose() is invoked. Disposed will set to True and for Views their OnWillDisposeWithChildren will be called.

public override void OnWillDisposeWithChildren()

OrderToPreparePlaneBackwardInBackground(DrawingContext)

protected void OrderToPreparePlaneBackwardInBackground(DrawingContext context)

Parameters

context DrawingContext

OrderToPreparePlaneForwardInBackground(DrawingContext)

protected void OrderToPreparePlaneForwardInBackground(DrawingContext context)

Parameters

context DrawingContext

Paint(DrawingContext)

This is the main drawing routine you should override to draw something. Base one paints background color inside DrawingRect that was defined by Arrange inside base.Draw. Pass arguments if you want to use some time-frozen data for painting at any time from any thread..

protected override void Paint(DrawingContext ctx)

Parameters

ctx DrawingContext

PaintOnPlane(DrawingContext, Plane)

protected virtual void PaintOnPlane(DrawingContext context, Plane plane)

Parameters

context DrawingContext
plane Plane

PaintViews(DrawingContext)

protected virtual void PaintViews(DrawingContext ctx)

Parameters

ctx DrawingContext

PassGestureToChildren(SkiaGesturesParameters, GestureEventProcessingInfo)

protected virtual ISkiaGestureListener PassGestureToChildren(SkiaGesturesParameters args, GestureEventProcessingInfo apply)

Parameters

args SkiaGesturesParameters
apply GestureEventProcessingInfo

Returns

ISkiaGestureListener

PlayEdgeGlowAnimation(Color, double, double, bool)

public void PlayEdgeGlowAnimation(Color color, double x, double y, bool removePrevious = true)

Parameters

color Color
x double
y double
removePrevious bool

PositionViewport(SKRect, SKPoint, float, float, bool)

Input offset parameters in PIXELS. This is called inside Draw, only if need reposition viewport. Here we can construct anything according current offset before painting. Creates a valid ViewportRect inside.

protected virtual bool PositionViewport(SKRect destination, SKPoint offsetPixels, float viewportScale, float scale, bool forceSyncOffsets)

Parameters

destination SKRect
offsetPixels SKPoint
viewportScale float
scale float
forceSyncOffsets bool

Returns

bool

Whether we changed viewport and cache changed

PreparePlane(DrawingContext, Plane)

protected virtual void PreparePlane(DrawingContext context, Plane plane)

Parameters

context DrawingContext
plane Plane

PrepareToFlingAfterInitialized(ScrollFlingAnimator)

protected virtual bool PrepareToFlingAfterInitialized(ScrollFlingAnimator animator)

Parameters

animator ScrollFlingAnimator

Returns

bool

ProcessGestures(SkiaGesturesParameters, GestureEventProcessingInfo)

public override ISkiaGestureListener ProcessGestures(SkiaGesturesParameters args, GestureEventProcessingInfo apply)

Parameters

args SkiaGesturesParameters
apply GestureEventProcessingInfo

Returns

ISkiaGestureListener

ProcessGesturesForPlane(Plane, SkiaGesturesParameters, GestureEventProcessingInfo)

Process gestures for a specific plane using its rendering tree

protected virtual ISkiaGestureListener ProcessGesturesForPlane(Plane plane, SkiaGesturesParameters args, GestureEventProcessingInfo apply)

Parameters

plane Plane
args SkiaGesturesParameters
apply GestureEventProcessingInfo

Returns

ISkiaGestureListener

ProcessGesturesForPlanes(SkiaGesturesParameters, GestureEventProcessingInfo)

Process gestures across all visible planes in correct Z-order

protected virtual ISkiaGestureListener ProcessGesturesForPlanes(SkiaGesturesParameters args, GestureEventProcessingInfo apply)

Parameters

args SkiaGesturesParameters
apply GestureEventProcessingInfo

Returns

ISkiaGestureListener

ResetOverscroll()

protected void ResetOverscroll()

ResetPan()

protected virtual void ResetPan()

ResetPosition()

Instant scroll to top

public virtual void ResetPosition()

ScrollTo(float, float, float, bool)

public virtual void ScrollTo(float x, float y, float maxSpeedSecs, bool clamp)

Parameters

x float
y float
maxSpeedSecs float
clamp bool

ScrollToBottom(float)

public void ScrollToBottom(float maxTimeSecs)

Parameters

maxTimeSecs float

ScrollToIndex(int, bool, RelativePositionType, bool)

public void ScrollToIndex(int index, bool animate, RelativePositionType option = RelativePositionType.Start, bool clamp = false)

Parameters

index int
animate bool
option RelativePositionType
clamp bool

ScrollToOffset(Vector2, float)

In Units

protected void ScrollToOffset(Vector2 targetOffset, float maxTimeSecs)

Parameters

targetOffset Vector2
maxTimeSecs float

ScrollToTop(float)

public void ScrollToTop(float maxTimeSecs)

Parameters

maxTimeSecs float

ScrollToX(float, bool)

Use Range scroller, offset in Units

public void ScrollToX(float offset, bool animate)

Parameters

offset float
animate bool

ScrollToY(float, bool)

Use Range scroller, offset in Units

protected void ScrollToY(float offset, bool animate)

Parameters

offset float
animate bool

SendScrolled()

protected void SendScrolled()

SendScrollingEnded()

protected void SendScrollingEnded()

SetChildren(IEnumerable<SkiaControl>)

public override void SetChildren(IEnumerable<SkiaControl> views)

Parameters

views IEnumerable<SkiaControl>

SetContent(SkiaControl)

Use Content property for direct access

protected virtual void SetContent(SkiaControl view)

Parameters

view SkiaControl

SetContentOffset(Vector2, bool, bool)

Easy-to-use helper around using a lower level ScrollTo function

public void SetContentOffset(Vector2 offset, bool animated, bool clamp)

Parameters

offset Vector2
animated bool
clamp bool

SetDetectIndexChildPoint(RelativePositionType)

protected virtual void SetDetectIndexChildPoint(RelativePositionType option = RelativePositionType.Start)

Parameters

option RelativePositionType

SetFooter(SkiaControl)

public void SetFooter(SkiaControl view)

Parameters

view SkiaControl

SetHeader(SkiaControl)

public void SetHeader(SkiaControl view)

Parameters

view SkiaControl

SetIsRefreshing(bool, bool)

public void SetIsRefreshing(bool state, bool initial)

Parameters

state bool
initial bool

SetMeasured(float, float, bool, bool, float)

Parameters in PIXELS. sets IsLayoutDirty = true;

protected override ScaledSize SetMeasured(float width, float height, bool widthCut, bool heightCut, float scale)

Parameters

width float
height float
widthCut bool
heightCut bool
scale float

Returns

ScaledSize

SetScrollOffset(SKRect, float, float, float, float, bool)

Pass position in PIXELS

protected virtual void SetScrollOffset(SKRect destination, float posX, float posY, float zoomedScale, float scale, bool forceSyncOffsets)

Parameters

destination SKRect
posX float
posY float
zoomedScale float
scale float
forceSyncOffsets bool

SetZoom(double)

public bool SetZoom(double zoom)

Parameters

zoom double

Returns

bool

ShouldSwapDown(SKRect)

Determines if we should swap down based on visual position and content boundaries

protected virtual bool ShouldSwapDown(SKRect rectForward)

Parameters

rectForward SKRect

Returns

bool

ShouldSwapUp(SKRect)

Determines if we should swap up based on visual position and content boundaries

protected virtual bool ShouldSwapUp(SKRect rectBackward)

Parameters

rectBackward SKRect

Returns

bool

ShowRefreshIndicatorForced()

protected virtual void ShowRefreshIndicatorForced()

Snap(float)

public virtual void Snap(float maxTimeSecs)

Parameters

maxTimeSecs float

StartToFlingFrom(ScrollFlingAnimator, float, float)

public virtual bool StartToFlingFrom(ScrollFlingAnimator animator, float from, float velocity)

Parameters

animator ScrollFlingAnimator
from float
velocity float

Returns

bool

StopScrolling()

public void StopScrolling()

StopVelocityPanning()

protected void StopVelocityPanning()

TriggerIncrementalMeasurement(SkiaLayout)

protected void TriggerIncrementalMeasurement(SkiaLayout layout)

Parameters

layout SkiaLayout

TriggerPreparePlane(DrawingContext, string)

protected void TriggerPreparePlane(DrawingContext context, string planeId)

Parameters

context DrawingContext
planeId string

UpdateByChild(SkiaControl)

To track dirty area when Updating parent

public override void UpdateByChild(SkiaControl control)

Parameters

control SkiaControl

UpdateFriction()

public void UpdateFriction()

UpdateVisibleIndex()

public virtual void UpdateVisibleIndex()

Events

IndexChanged

public event EventHandler<int> IndexChanged

Event Type

EventHandler<int>

Scrolled

public event EventHandler<ScaledPoint> Scrolled

Event Type

EventHandler<ScaledPoint>

ScrollingEnded

public event EventHandler<ScaledPoint> ScrollingEnded

Event Type

EventHandler<ScaledPoint>