Class SkiaScroll
[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
AdaptToKeyboardSizeProperty
public static readonly BindableProperty AdaptToKeyboardSizeProperty
Field Value
AutoScrollingSpeedMsProperty
public static readonly BindableProperty AutoScrollingSpeedMsProperty
Field Value
BouncesProperty
ToDo adapt this to same logic as ScrollLooped has !
public static readonly BindableProperty BouncesProperty
Field Value
CanScrollUsingHeaderProperty
public static readonly BindableProperty CanScrollUsingHeaderProperty
Field Value
ChangeDistancePannedProperty
public static readonly BindableProperty ChangeDistancePannedProperty
Field Value
ChangeVelocityScrolledProperty
public static readonly BindableProperty ChangeVelocityScrolledProperty
Field Value
ContentGesturesHit
protected bool ContentGesturesHit
Field Value
ContentOffsetProperty
public static readonly BindableProperty ContentOffsetProperty
Field Value
ContentProperty
public static readonly BindableProperty ContentProperty
Field Value
DetectIndexChildAt
protected SKPoint DetectIndexChildAt
Field Value
DetectIndexChildEndAt
protected SKPoint DetectIndexChildEndAt
Field Value
DetectIndexChildStartAt
protected SKPoint DetectIndexChildStartAt
Field Value
Elastic
public static int Elastic
Field Value
FooterProperty
public static readonly BindableProperty FooterProperty
Field Value
FooterSize
protected ScaledSize FooterSize
Field Value
FrictionScrolledProperty
public static readonly BindableProperty FrictionScrolledProperty
Field Value
HeaderBehindProperty
public static readonly BindableProperty HeaderBehindProperty
Field Value
HeaderParallaxRatioProperty
public static readonly BindableProperty HeaderParallaxRatioProperty
Field Value
HeaderProperty
public static readonly BindableProperty HeaderProperty
Field Value
HeaderSize
protected ScaledSize HeaderSize
Field Value
HeaderStickyProperty
public static readonly BindableProperty HeaderStickyProperty
Field Value
IgnoreWrongDirectionProperty
public static readonly BindableProperty IgnoreWrongDirectionProperty
Field Value
InContact
protected bool InContact
Field Value
IsRefreshingProperty
public static readonly BindableProperty IsRefreshingProperty
Field Value
LastContentSizePixels
protected SKSize LastContentSizePixels
Field Value
LastMeasuredSizePixels
protected SKSize LastMeasuredSizePixels
Field Value
LoadMoreCommandProperty
public static readonly BindableProperty LoadMoreCommandProperty
Field Value
LoadMoreOffsetProperty
public static readonly BindableProperty LoadMoreOffsetProperty
Field Value
LockGesturesUntilDown
protected bool LockGesturesUntilDown
Field Value
MaxBounceVelocityProperty
public static readonly BindableProperty MaxBounceVelocityProperty
Field Value
MaxVelocityProperty
public static readonly BindableProperty MaxVelocityProperty
Field Value
OrderedScrollIsAnimatedProperty
public static readonly BindableProperty OrderedScrollIsAnimatedProperty
Field Value
OrderedScrollProperty
public static readonly BindableProperty OrderedScrollProperty
Field Value
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
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
OrientationProperty
public static readonly BindableProperty OrientationProperty
Field Value
ParallaxOverscrollEnabledProperty
public static readonly BindableProperty ParallaxOverscrollEnabledProperty
Field Value
PlaneBlue
public const string PlaneBlue = "Blue"
Field Value
PlaneGreen
public const string PlaneGreen = "Greeen"
Field Value
PlaneRed
public const string PlaneRed = "Red"
Field Value
RefreshCommandProperty
public static readonly BindableProperty RefreshCommandProperty
Field Value
RefreshDistanceLimitProperty
public static readonly BindableProperty RefreshDistanceLimitProperty
Field Value
RefreshEnabledProperty
public static readonly BindableProperty RefreshEnabledProperty
Field Value
RefreshIndicatorProperty
public static readonly BindableProperty RefreshIndicatorProperty
Field Value
RefreshShowDistanceProperty
public static readonly BindableProperty RefreshShowDistanceProperty
Field Value
ResetScrollPositionOnContentSizeChangedProperty
public static readonly BindableProperty ResetScrollPositionOnContentSizeChangedProperty
Field Value
RespondsToGesturesProperty
public static readonly BindableProperty RespondsToGesturesProperty
Field Value
RubberDampingProperty
public static readonly BindableProperty RubberDampingProperty
Field Value
RubberEffectProperty
public static readonly BindableProperty RubberEffectProperty
Field Value
ScrollTypeProperty
public static readonly BindableProperty ScrollTypeProperty
Field Value
ScrollVelocityThreshold
To filter micro-gestures while manually panning
public static float ScrollVelocityThreshold
Field Value
ScrollingEasing
public Easing ScrollingEasing
Field Value
ScrollingSpeedMsProperty
public static readonly BindableProperty ScrollingSpeedMsProperty
Field Value
SnapBouncingIfVelocityLessThanProperty
public static readonly BindableProperty SnapBouncingIfVelocityLessThanProperty
Field Value
SnapToChildrenProperty
public static readonly BindableProperty SnapToChildrenProperty
Field Value
SystemAnimationTimeSecs
Time for the snapping animations as well as the scroll to top etc animations..
public static float SystemAnimationTimeSecs
Field Value
ThesholdSwipeOnUp
Min velocity in points/sec to flee/swipe when finger is up
public static float ThesholdSwipeOnUp
Field Value
TrackIndexPositionOffsetProperty
public static readonly BindableProperty TrackIndexPositionOffsetProperty
Field Value
TrackIndexPositionProperty
public static readonly BindableProperty TrackIndexPositionProperty
Field Value
VelocityImageLoaderLockProperty
public static readonly BindableProperty VelocityImageLoaderLockProperty
Field Value
VelocityTrackerPan
protected VelocityTracker VelocityTrackerPan
Field Value
VelocityTrackerScale
protected VelocityTracker VelocityTrackerScale
Field Value
ViewportZoomProperty
public static readonly BindableProperty ViewportZoomProperty
Field Value
WheelLineSize
How many points (not pixels) we want to scroll for 1 wheel line
public static float WheelLineSize
Field Value
ZoomLockedProperty
public static readonly BindableProperty ZoomLockedProperty
Field Value
ZoomMaxProperty
public static readonly BindableProperty ZoomMaxProperty
Field Value
ZoomMinProperty
public static readonly BindableProperty ZoomMinProperty
Field Value
_animatorFlingX
Fling with deceleration
protected ScrollFlingAnimator _animatorFlingX
Field Value
_animatorFlingY
Fling with deceleration
protected ScrollFlingAnimator _animatorFlingY
Field Value
_minVelocity
protected double _minVelocity
Field Value
_minVelocitySnap
protected float _minVelocitySnap
Field Value
_pannedOffset
protected Vector2 _pannedOffset
Field Value
_pannedVelocity
protected Vector2 _pannedVelocity
Field Value
_pannedVelocityRemaining
protected Vector2 _pannedVelocityRemaining
Field Value
_panningCurrentOffsetPts
protected Vector2 _panningCurrentOffsetPts
Field Value
_panningLastDelta
protected Vector2 _panningLastDelta
Field Value
_planeHeight
protected int _planeHeight
Field Value
_planePrepareThreshold
protected int _planePrepareThreshold
Field Value
_planeWidth
protected int _planeWidth
Field Value
_scrollMaxX
protected float _scrollMaxX
Field Value
_scrollMaxY
protected float _scrollMaxY
Field Value
_scrollMinX
Units
protected float _scrollMinX
Field Value
_scrollMinY
Units
protected float _scrollMinY
Field Value
_scrollerX
Direct scroller for ordered scroll, snap etc
protected RangeAnimator _scrollerX
Field Value
_scrollerY
Direct scroller for ordered scroll, snap etc
protected RangeAnimator _scrollerY
Field Value
_vectorAnimatorBounceX
protected SpringWithVelocityAnimator _vectorAnimatorBounceX
Field Value
_vectorAnimatorBounceY
protected SpringWithVelocityAnimator _vectorAnimatorBounceY
Field Value
_velocitySwipe
protected float _velocitySwipe
Field Value
_velocitySwipeRatio
protected float _velocitySwipeRatio
Field Value
_viewportOffsetX
protected float _viewportOffsetX
Field Value
_viewportOffsetY
protected float _viewportOffsetY
Field Value
ptsContentHeight
protected float ptsContentHeight
Field Value
ptsContentWidth
protected float ptsContentWidth
Field Value
snapMinimumVelocity
POINTS per sec
protected float snapMinimumVelocity
Field Value
Properties
AdaptToKeyboardFor
public SkiaControl AdaptToKeyboardFor { get; set; }
Property Value
AdaptToKeyboardSize
public double AdaptToKeyboardSize { get; set; }
Property Value
AutoScrollingSpeedMs
For snap and ordered scrolling
public int AutoScrollingSpeedMs { get; set; }
Property Value
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
CanScrollUsingHeader
If disabled will not scroll using gestures. Scrolling will still be possible by code.
public bool CanScrollUsingHeader { get; set; }
Property Value
ChangeDistancePanned
For when the finger is down and panning
public float ChangeDistancePanned { get; set; }
Property Value
ChangeVelocityScrolled
For when the finger is up and swipe is detected
public float ChangeVelocityScrolled { get; set; }
Property Value
ChildWasPanning
protected bool ChildWasPanning { get; set; }
Property Value
ChildWasTapped
protected bool ChildWasTapped { get; set; }
Property Value
Content
public SkiaControl Content { get; set; }
Property Value
ContentAvailableSpace
public SKRect ContentAvailableSpace { get; protected set; }
Property Value
ContentOffset
public double ContentOffset { get; set; }
Property Value
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
ContentRectWithOffset
The viewport for content
public ScaledRect ContentRectWithOffset { get; protected set; }
Property Value
ContentViewport
public ScaledRect ContentViewport { get; protected set; }
Property Value
CurrentIndex
public int CurrentIndex { get; protected set; }
Property Value
CurrentIndexHit
public ContainsPointResult CurrentIndexHit { get; set; }
Property Value
DecelerationRatio
public float DecelerationRatio { get; set; }
Property Value
FirstVisibleIndex
public int FirstVisibleIndex { get; set; }
Property Value
Footer
public SkiaControl Footer { get; set; }
Property Value
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
HadDown
public bool HadDown { get; protected set; }
Property Value
HasContentToScroll
public bool HasContentToScroll { get; set; }
Property Value
Header
public SkiaControl Header { get; set; }
Property Value
HeaderBehind
public bool HeaderBehind { get; set; }
Property Value
HeaderParallaxRatio
public double HeaderParallaxRatio { get; set; }
Property Value
HeaderSticky
Should the header stay in place when content is scrolling
public bool HeaderSticky { get; set; }
Property Value
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
IncrementalMeasureAheadCount
protected virtual int IncrementalMeasureAheadCount { get; set; }
Property Value
IncrementalMeasureBatchSize
protected virtual int IncrementalMeasureBatchSize { get; set; }
Property Value
InteractionState
public ScrollInteractionState InteractionState { get; set; }
Property Value
InternalRefreshIndicator
protected IRefreshIndicator InternalRefreshIndicator { get; set; }
Property Value
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
IsAnimating
public bool IsAnimating { get; set; }
Property Value
IsBouncing
public bool IsBouncing { get; set; }
Property Value
IsContentActive
protected virtual bool IsContentActive { get; }
Property Value
IsRefreshing
public bool IsRefreshing { get; set; }
Property Value
IsScrolling
public bool IsScrolling { get; set; }
Property Value
IsSnapping
public bool IsSnapping { get; set; }
Property Value
IsUserFocused
public bool IsUserFocused { get; protected set; }
Property Value
IsUserPanning
public bool IsUserPanning { get; protected set; }
Property Value
IsViewportReady
public bool IsViewportReady { get; protected set; }
Property Value
LastVisibleIndex
public int LastVisibleIndex { get; set; }
Property Value
LoadMoreCommand
public ICommand LoadMoreCommand { get; set; }
Property Value
LoadMoreOffset
public float LoadMoreOffset { get; set; }
Property Value
MaxBounceVelocity
Limit bounce velocity
public float MaxBounceVelocity { get; set; }
Property Value
MaxVelocity
Limit user input velocity
public float MaxVelocity { get; set; }
Property Value
MeasurementTriggerDistance
protected virtual double MeasurementTriggerDistance { get; set; }
Property Value
NeedMeasure
public override bool NeedMeasure { get; set; }
Property Value
OrderedScroll
public int OrderedScroll { get; set; }
Property Value
OrderedScrollIsAnimated
public bool OrderedScrollIsAnimated { get; set; }
Property Value
Orientation
public ScrollOrientation Orientation { get; set; }
Property Value
OverScrolled
public bool OverScrolled { get; }
Property Value
OverscrollDistance
Units
public Vector2 OverscrollDistance { get; set; }
Property Value
ParallaxComputedValue
public double ParallaxComputedValue { get; set; }
Property Value
ParallaxOverscrollEnabled
public bool ParallaxOverscrollEnabled { get; set; }
Property Value
PlaneBackward
protected Plane PlaneBackward { get; set; }
Property Value
PlaneCurrent
protected Plane PlaneCurrent { get; set; }
Property Value
PlaneForward
protected Plane PlaneForward { get; set; }
Property Value
RefreshCommand
public ICommand RefreshCommand { get; set; }
Property Value
RefreshDistanceLimit
Applyed to RefreshView
public float RefreshDistanceLimit { get; set; }
Property Value
RefreshEnabled
public bool RefreshEnabled { get; set; }
Property Value
RefreshIndicator
public IRefreshIndicator RefreshIndicator { get; set; }
Property Value
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
ResetScrollPositionOnContentSizeChanged
public bool ResetScrollPositionOnContentSizeChanged { get; set; }
Property Value
RespondsToGestures
If disabled will not scroll using gestures. Scrolling will still be possible by code.
public bool RespondsToGestures { get; set; }
Property Value
ReverseGestures
public bool ReverseGestures { get; set; }
Property Value
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
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
ScrollLocked
public bool ScrollLocked { get; set; }
Property Value
ScrollProgressX
0.0 - 1.0
public double ScrollProgressX { get; }
Property Value
ScrollProgressY
0.0 - 1.0
public double ScrollProgressY { get; }
Property Value
ScrollType
public ViewportScrollType ScrollType { get; set; }
Property Value
ScrollingDirection
public LinearDirectionType ScrollingDirection { get; protected set; }
Property Value
ScrollingSpeedMs
Used by range scroller (ScrollToX, ScrollToY)
public int ScrollingSpeedMs { get; set; }
Property Value
SnapBouncingIfVelocityLessThan
public float SnapBouncingIfVelocityLessThan { get; set; }
Property Value
SnapToChildren
Whether should snap to children after scrolling stopped
public SnapToChildrenType SnapToChildren { get; set; }
Property Value
Snapped
public bool Snapped { get; set; }
Property Value
SwipeVelocityAccumulator
protected VelocityAccumulator SwipeVelocityAccumulator { get; }
Property Value
TrackIndexPosition
The position in viewport you want to track for content layout child index
public RelativePositionType TrackIndexPosition { get; set; }
Property Value
TrackIndexPositionOffset
public float TrackIndexPositionOffset { get; set; }
Property Value
UseVirtual
public virtual bool UseVirtual { get; }
Property Value
UsesRenderingTree
public override bool UsesRenderingTree { get; }
Property Value
UsingRefreshDistanceLimit
protected double UsingRefreshDistanceLimit { get; }
Property Value
VelocityImageLoaderLock
Range at which the image loader will stop or resume loading images while scrolling
public double VelocityImageLoaderLock { get; set; }
Property Value
VelocityX
public float VelocityX { get; set; }
Property Value
VelocityY
public float VelocityY { get; set; }
Property Value
Viewport
public ScaledRect Viewport { get; protected set; }
Property Value
ViewportOffsetX
public float ViewportOffsetX { get; set; }
Property Value
ViewportOffsetY
public float ViewportOffsetY { get; set; }
Property Value
ViewportZoom
public double ViewportZoom { get; set; }
Property Value
WasSwiping
Had no panning just down+up with velocity more than threshold
protected bool WasSwiping { get; set; }
Property Value
WillClipBounds
Used to check whether to apply IsClippedToBounds property
public override bool WillClipBounds { get; }
Property Value
ZoomLocked
public bool ZoomLocked { get; set; }
Property Value
ZoomMax
public double ZoomMax { get; set; }
Property Value
ZoomMin
public double ZoomMin { get; set; }
Property Value
ZoomScaleInternal
We might have difference between pinch scale and manually set zoom.
protected double ZoomScaleInternal { get; set; }
Property Value
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
ApplyScrollPositionToRefreshViewUnsafe()
protected virtual void ApplyScrollPositionToRefreshViewUnsafe()
BounceIfNeeded(ScrollFlingAnimator)
protected virtual void BounceIfNeeded(ScrollFlingAnimator animator)
Parameters
animatorScrollFlingAnimator
CalculateNeededScrollForKeyboard()
public void CalculateNeededScrollForKeyboard()
CalculateOverscrollDistance(float, float)
In POINTS not pixels!!!
public Vector2 CalculateOverscrollDistance(float x, float y)
Parameters
Returns
CalculateScrollOffsetForIndex(int, RelativePositionType)
ToDo this actually work only for Stack and Row
public virtual SKPoint CalculateScrollOffsetForIndex(int index, RelativePositionType option)
Parameters
indexintoptionRelativePositionType
Returns
CalculateViewportForPlane(Plane, SKPoint)
Calculate the specific viewport area this plane should render
protected virtual SKRect CalculateViewportForPlane(Plane plane, SKPoint offsetToUse)
Parameters
Returns
CalculateVisibleIndex(RelativePositionType)
Calculates CurrentIndex
public virtual ContainsPointResult CalculateVisibleIndex(RelativePositionType option)
Parameters
optionRelativePositionType
Returns
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
ClampOffset(float, float, SKRect, bool)
public virtual Vector2 ClampOffset(float x, float y, SKRect contentOffsetBounds, bool strict = false)
Parameters
Returns
ClampOffsetHard(float, float)
"Just clamp". Currently used for wheel scroll.
protected virtual Vector2 ClampOffsetHard(float x, float y)
Parameters
Returns
ClampOffsetWithRubberBand(float, float, SKRect)
Used to clamp while panning while finger is down
protected virtual Vector2 ClampOffsetWithRubberBand(float x, float y, SKRect contentOffsetBounds)
Parameters
Returns
ClampedOrderedScrollOffset(SKPoint)
protected virtual SKPoint ClampedOrderedScrollOffset(SKPoint scrollTo)
Parameters
scrollToSKPoint
Returns
ClosestPoint(SKRect, SKPoint)
public static SKPoint ClosestPoint(SKRect rect, SKPoint point)
Parameters
Returns
Draw(DrawingContext)
protected override void Draw(DrawingContext context)
Parameters
contextDrawingContext
DrawViews(DrawingContext)
Base method will call RenderViewsList. Return number of drawn views.
protected override int DrawViews(DrawingContext context)
Parameters
contextDrawingContext
Returns
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
contextDrawingContext
ExecuteDelayedScrollOrders()
public virtual void ExecuteDelayedScrollOrders()
ExecuteScrollToIndexOrder()
public bool ExecuteScrollToIndexOrder()
Returns
ExecuteScrollToOrder()
public bool ExecuteScrollToOrder()
Returns
FindPlaneContainingChild(SkiaControl)
Determines which plane contains the given child control by checking render trees
protected virtual Plane FindPlaneContainingChild(SkiaControl control)
Parameters
controlSkiaControl
Returns
FlingAfterInitialized(ScrollFlingAnimator)
protected Task<bool> FlingAfterInitialized(ScrollFlingAnimator animator)
Parameters
animatorScrollFlingAnimator
Returns
FlingFrom(ScrollFlingAnimator, float, float)
protected virtual Task<bool> FlingFrom(ScrollFlingAnimator animator, float from, float velocity)
Parameters
animatorScrollFlingAnimatorfromfloatvelocityfloat
Returns
FlingTo(ScrollFlingAnimator, float, float, float)
protected virtual Task<bool> FlingTo(ScrollFlingAnimator animator, float from, float to, float timeSeconds)
Parameters
animatorScrollFlingAnimatorfromfloattofloattimeSecondsfloat
Returns
FlingToAuto(ScrollFlingAnimator, float, float, float)
protected virtual Task<bool> FlingToAuto(ScrollFlingAnimator animator, float from, float to, float changeSpeedSecs = 0)
Parameters
animatorScrollFlingAnimatorfromfloattofloatchangeSpeedSecsfloat
Returns
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
Returns
GetContentAvailableRect(SKRect)
In PIXELS
protected virtual SKRect GetContentAvailableRect(SKRect destination)
Parameters
destinationSKRect
Returns
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
GetItemIndex(SkiaLayout, float, float, RelativePositionType)
public virtual ContainsPointResult GetItemIndex(SkiaLayout layout, float pixelsOffsetX, float pixelsOffsetY, RelativePositionType option)
Parameters
layoutSkiaLayoutpixelsOffsetXfloatpixelsOffsetYfloatoptionRelativePositionType
Returns
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
contextDrawingContextinflateByPixelsVector2
Returns
GetPlaneById(string)
protected virtual Plane GetPlaneById(string planeId)
Parameters
planeIdstring
Returns
GetVisibleIndexes(SkiaLayout, float, float)
public virtual (ContainsPointResult Current, ContainsPointResult Start, ContainsPointResult End) GetVisibleIndexes(SkiaLayout layout, float pixelsOffsetX, float pixelsOffsetY)
Parameters
layoutSkiaLayoutpixelsOffsetXfloatpixelsOffsetYfloat
Returns
HasDirtyChildren()
protected virtual bool HasDirtyChildren()
Returns
HideRefreshIndicator()
protected virtual void HideRefreshIndicator()
Init()
protected void Init()
InitializePlanes()
public virtual void InitializePlanes()
InitializeScroller(float)
protected virtual void InitializeScroller(float scale)
Parameters
scalefloat
InitializeViewport(float)
protected virtual void InitializeViewport(float scale)
Parameters
scalefloat
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
listenerISkiaGestureListenerpointSKPoint
Returns
IsGestureForChild(ISkiaGestureListener, float, float)
public override bool IsGestureForChild(ISkiaGestureListener listener, float x, float y)
Parameters
listenerISkiaGestureListenerxfloatyfloat
Returns
IsGestureForChild(SkiaControl, SkiaGesturesParameters)
public override bool IsGestureForChild(SkiaControl child, SkiaGesturesParameters args)
Parameters
childSkiaControlargsSkiaGesturesParameters
Returns
IsGestureForChild(SkiaControlWithRect, SKPoint)
public override bool IsGestureForChild(SkiaControlWithRect child, SKPoint point)
Parameters
childSkiaControlWithRectpointSKPoint
Returns
IsGestureInPlane(Plane, PointF)
Check if gesture point intersects with plane's visible area
protected virtual bool IsGestureInPlane(Plane plane, PointF location)
Parameters
Returns
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
Returns
MeasureInternal(MeasureRequest)
protected override ScaledSize MeasureInternal(MeasureRequest request)
Parameters
requestMeasureRequest
Returns
MoveToX(float)
public virtual void MoveToX(float value)
Parameters
valuefloat
MoveToY(float)
public virtual void MoveToY(float value)
Parameters
valuefloat
OffsetOk(Vector2)
Whether the scrolling offset in inside scrollable bounds or not
protected virtual bool OffsetOk(Vector2 offset)
Parameters
offsetVector2
Returns
OnDrawn(DrawingContext)
protected virtual void OnDrawn(DrawingContext context)
Parameters
contextDrawingContext
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
propertyNamestringThe 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
valuebool
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
contextDrawingContext
OrderToPreparePlaneForwardInBackground(DrawingContext)
protected void OrderToPreparePlaneForwardInBackground(DrawingContext context)
Parameters
contextDrawingContext
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
ctxDrawingContext
PaintOnPlane(DrawingContext, Plane)
protected virtual void PaintOnPlane(DrawingContext context, Plane plane)
Parameters
contextDrawingContextplanePlane
PaintViews(DrawingContext)
protected virtual void PaintViews(DrawingContext ctx)
Parameters
ctxDrawingContext
PassGestureToChildren(SkiaGesturesParameters, GestureEventProcessingInfo)
protected virtual ISkiaGestureListener PassGestureToChildren(SkiaGesturesParameters args, GestureEventProcessingInfo apply)
Parameters
argsSkiaGesturesParametersapplyGestureEventProcessingInfo
Returns
PlayEdgeGlowAnimation(Color, double, double, bool)
public void PlayEdgeGlowAnimation(Color color, double x, double y, bool removePrevious = true)
Parameters
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
Returns
- bool
Whether we changed viewport and cache changed
PreparePlane(DrawingContext, Plane)
protected virtual void PreparePlane(DrawingContext context, Plane plane)
Parameters
contextDrawingContextplanePlane
PrepareToFlingAfterInitialized(ScrollFlingAnimator)
protected virtual bool PrepareToFlingAfterInitialized(ScrollFlingAnimator animator)
Parameters
animatorScrollFlingAnimator
Returns
ProcessGestures(SkiaGesturesParameters, GestureEventProcessingInfo)
public override ISkiaGestureListener ProcessGestures(SkiaGesturesParameters args, GestureEventProcessingInfo apply)
Parameters
argsSkiaGesturesParametersapplyGestureEventProcessingInfo
Returns
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
planePlaneargsSkiaGesturesParametersapplyGestureEventProcessingInfo
Returns
ProcessGesturesForPlanes(SkiaGesturesParameters, GestureEventProcessingInfo)
Process gestures across all visible planes in correct Z-order
protected virtual ISkiaGestureListener ProcessGesturesForPlanes(SkiaGesturesParameters args, GestureEventProcessingInfo apply)
Parameters
argsSkiaGesturesParametersapplyGestureEventProcessingInfo
Returns
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
ScrollToBottom(float)
public void ScrollToBottom(float maxTimeSecs)
Parameters
maxTimeSecsfloat
ScrollToIndex(int, bool, RelativePositionType, bool)
public void ScrollToIndex(int index, bool animate, RelativePositionType option = RelativePositionType.Start, bool clamp = false)
Parameters
indexintanimatebooloptionRelativePositionTypeclampbool
ScrollToOffset(Vector2, float)
In Units
protected void ScrollToOffset(Vector2 targetOffset, float maxTimeSecs)
Parameters
ScrollToTop(float)
public void ScrollToTop(float maxTimeSecs)
Parameters
maxTimeSecsfloat
ScrollToX(float, bool)
Use Range scroller, offset in Units
public void ScrollToX(float offset, bool animate)
Parameters
ScrollToY(float, bool)
Use Range scroller, offset in Units
protected void ScrollToY(float offset, bool animate)
Parameters
SendScrolled()
protected void SendScrolled()
SendScrollingEnded()
protected void SendScrollingEnded()
SetChildren(IEnumerable<SkiaControl>)
public override void SetChildren(IEnumerable<SkiaControl> views)
Parameters
viewsIEnumerable<SkiaControl>
SetContent(SkiaControl)
Use Content property for direct access
protected virtual void SetContent(SkiaControl view)
Parameters
viewSkiaControl
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
SetDetectIndexChildPoint(RelativePositionType)
protected virtual void SetDetectIndexChildPoint(RelativePositionType option = RelativePositionType.Start)
Parameters
optionRelativePositionType
SetFooter(SkiaControl)
public void SetFooter(SkiaControl view)
Parameters
viewSkiaControl
SetHeader(SkiaControl)
public void SetHeader(SkiaControl view)
Parameters
viewSkiaControl
SetIsRefreshing(bool, bool)
public void SetIsRefreshing(bool state, bool initial)
Parameters
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
Returns
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
SetZoom(double)
public bool SetZoom(double zoom)
Parameters
zoomdouble
Returns
ShouldSwapDown(SKRect)
Determines if we should swap down based on visual position and content boundaries
protected virtual bool ShouldSwapDown(SKRect rectForward)
Parameters
rectForwardSKRect
Returns
ShouldSwapUp(SKRect)
Determines if we should swap up based on visual position and content boundaries
protected virtual bool ShouldSwapUp(SKRect rectBackward)
Parameters
rectBackwardSKRect
Returns
ShowRefreshIndicatorForced()
protected virtual void ShowRefreshIndicatorForced()
Snap(float)
public virtual void Snap(float maxTimeSecs)
Parameters
maxTimeSecsfloat
StartToFlingFrom(ScrollFlingAnimator, float, float)
public virtual bool StartToFlingFrom(ScrollFlingAnimator animator, float from, float velocity)
Parameters
animatorScrollFlingAnimatorfromfloatvelocityfloat
Returns
StopScrolling()
public void StopScrolling()
StopVelocityPanning()
protected void StopVelocityPanning()
TriggerIncrementalMeasurement(SkiaLayout)
protected void TriggerIncrementalMeasurement(SkiaLayout layout)
Parameters
layoutSkiaLayout
TriggerPreparePlane(DrawingContext, string)
protected void TriggerPreparePlane(DrawingContext context, string planeId)
Parameters
contextDrawingContextplaneIdstring
UpdateByChild(SkiaControl)
To track dirty area when Updating parent
public override void UpdateByChild(SkiaControl control)
Parameters
controlSkiaControl
UpdateFriction()
public void UpdateFriction()
UpdateVisibleIndex()
public virtual void UpdateVisibleIndex()
Events
IndexChanged
public event EventHandler<int> IndexChanged
Event Type
Scrolled
public event EventHandler<ScaledPoint> Scrolled
Event Type
ScrollingEnded
public event EventHandler<ScaledPoint> ScrollingEnded