Table of Contents

Class SkiaWheelScroll

Namespace
DrawnUi.Controls
Assembly
DrawnUi.Maui.dll

A specialized scroll view that displays items in a 3D wheel-like arrangement

public class SkiaWheelScroll : VirtualScroll, 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
SkiaWheelScroll
Implements
Inherited Members
Extension Methods

Fields

DataSource

protected List<string> DataSource

Field Value

List<string>

FadeMinProperty

public static readonly BindableProperty FadeMinProperty

Field Value

BindableProperty

FadeProperty

public static readonly BindableProperty FadeProperty

Field Value

BindableProperty

FadeStrengthProperty

public static readonly BindableProperty FadeStrengthProperty

Field Value

BindableProperty

HapticEnabledProperty

public static readonly BindableProperty HapticEnabledProperty

Field Value

BindableProperty

Helper3dChildren

protected readonly Sk3dView Helper3dChildren

Field Value

Sk3dView

IsLoopedProperty

public static readonly BindableProperty IsLoopedProperty

Field Value

BindableProperty

ItemsWrapper

protected SkiaLayout? ItemsWrapper

Field Value

SkiaLayout

LinesColorProperty

public static readonly BindableProperty LinesColorProperty

Field Value

BindableProperty

SelectedIndexProperty

public static readonly BindableProperty SelectedIndexProperty

Field Value

BindableProperty

VisibleItemCountProperty

public static readonly BindableProperty VisibleItemCountProperty

Field Value

BindableProperty

Properties

CellsCount

protected int CellsCount { get; }

Property Value

int

CellsPool

protected WheelCellInfo[] CellsPool { get; }

Property Value

WheelCellInfo[]

DebugWheel

public string DebugWheel { get; }

Property Value

string

Fade

public bool Fade { get; set; }

Property Value

bool

FadeMin

How much the alpha at edges if fading is enabled. Default id 0.05f.

public float FadeMin { get; set; }

Property Value

float

FadeStrength

How much the alpha fading is pronounced. 0-1. Default id 0.2f.

public float FadeStrength { get; set; }

Property Value

float

HapticEnabled

public bool HapticEnabled { get; set; }

Property Value

bool

HorizontalChildAlignement

public DrawImageAlignment HorizontalChildAlignement { get; }

Property Value

DrawImageAlignment

IsLooped

public bool IsLooped { get; set; }

Property Value

bool

ItemHeight

protected float ItemHeight { get; set; }

Property Value

float

ItemsSourceCount

public int ItemsSourceCount { get; }

Property Value

int

LinesColor

public Color LinesColor { get; set; }

Property Value

Color

SelectedIndex

Gets or sets the index of the currently selected item

public int SelectedIndex { get; set; }

Property Value

int

Use3d

public bool Use3d { get; }

Property Value

bool

UseSpacing

protected float UseSpacing { get; }

Property Value

float

VisibleCellsCountHalf

protected int VisibleCellsCountHalf { get; }

Property Value

int

VisibleItemCount

public int VisibleItemCount { get; set; }

Property Value

int

WheelHalfHeight

protected float WheelHalfHeight { get; }

Property Value

float

WheelScrollingOffset

public float WheelScrollingOffset { get; set; }

Property Value

float

WheelVerticalCenter

protected float WheelVerticalCenter { get; }

Property Value

float

Methods

ActualizeSelectedIndex()

Updates the SelectedIndex property based on current scroll position

protected void ActualizeSelectedIndex()

ApplyVisibleItemCount()

public void ApplyVisibleItemCount()

AvoidRemeasuring(MeasureRequest)

public override bool AvoidRemeasuring(MeasureRequest request)

Parameters

request MeasureRequest

Returns

bool

CheckNeedToSnap()

protected override bool CheckNeedToSnap()

Returns

bool

ClampOffset(float, float, SKRect, bool)

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

Parameters

x float
y float
contentOffsetBounds SKRect
strict bool

Returns

Vector2

CreateDefaultContent()

protected override void CreateDefaultContent()

DrawVirtual(DrawingContext)

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

public override void DrawVirtual(DrawingContext context)

Parameters

context DrawingContext

GetCellPositionForIndex(int)

public int GetCellPositionForIndex(int index)

Parameters

index int

Returns

int

GetIndexAtCellPosition(int)

public int GetIndexAtCellPosition(int position)

Parameters

position int

Returns

int

IsIndexValid(int)

public bool IsIndexValid(int position)

Parameters

position int

Returns

bool

MeasureContent(float, float, float)

Calculate the value that will be set to ContentSize after that

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

Parameters

width float
height float
scale float

Returns

ScaledSize

OnLayoutChanged()

DrawingRect size changed

protected override void OnLayoutChanged()

OnLayoutPositionChanged()

DrawingRect location changed. This will not be called if OnLayoutChanged was invoked for this frame!

protected override void OnLayoutPositionChanged()

OnScrollCompleted()

This triggers smapping checks and actions

protected override void OnScrollCompleted()

OnSelectedIndexChanged(int)

Raises the SelectedIndexChanged event

protected virtual void OnSelectedIndexChanged(int newIndex)

Parameters

newIndex int

PaintSelectionIndicator(DrawingContext)

Draw selection indicator lines if needed

protected virtual void PaintSelectionIndicator(DrawingContext context)

Parameters

context DrawingContext

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 override 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

ProcessGestures(SkiaGesturesParameters, GestureEventProcessingInfo)

public override ISkiaGestureListener ProcessGestures(SkiaGesturesParameters args, GestureEventProcessingInfo apply)

Parameters

args SkiaGesturesParameters
apply GestureEventProcessingInfo

Returns

ISkiaGestureListener

ScrollToIndex(int, bool, float)

public void ScrollToIndex(int index, bool animated = true, float duration = 0.3)

Parameters

index int
animated bool
duration float

SetContentSize()

protected override void SetContentSize()

Snap(float)

public override void Snap(float maxTimeSecs)

Parameters

maxTimeSecs float

StartToFlingFrom(ScrollFlingAnimator, float, float)

Initiates a fling animation that precisely mirrors the Xamarin Android implementation

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

Parameters

animator ScrollFlingAnimator
from float
velocity float

Returns

bool

Events

SelectedIndexChanged

Event raised when the selected index changes

public event EventHandler<int> SelectedIndexChanged

Event Type

EventHandler<int>