Class SkiaWheelScroll
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
FadeMinProperty
public static readonly BindableProperty FadeMinProperty
Field Value
FadeProperty
public static readonly BindableProperty FadeProperty
Field Value
FadeStrengthProperty
public static readonly BindableProperty FadeStrengthProperty
Field Value
HapticEnabledProperty
public static readonly BindableProperty HapticEnabledProperty
Field Value
Helper3dChildren
protected readonly Sk3dView Helper3dChildren
Field Value
IsLoopedProperty
public static readonly BindableProperty IsLoopedProperty
Field Value
ItemsWrapper
protected SkiaLayout? ItemsWrapper
Field Value
LinesColorProperty
public static readonly BindableProperty LinesColorProperty
Field Value
SelectedIndexProperty
public static readonly BindableProperty SelectedIndexProperty
Field Value
VisibleItemCountProperty
public static readonly BindableProperty VisibleItemCountProperty
Field Value
Properties
CellsCount
protected int CellsCount { get; }
Property Value
CellsPool
protected WheelCellInfo[] CellsPool { get; }
Property Value
DebugWheel
public string DebugWheel { get; }
Property Value
Fade
public bool Fade { get; set; }
Property Value
FadeMin
How much the alpha at edges if fading is enabled. Default id 0.05f.
public float FadeMin { get; set; }
Property Value
FadeStrength
How much the alpha fading is pronounced. 0-1. Default id 0.2f.
public float FadeStrength { get; set; }
Property Value
HapticEnabled
public bool HapticEnabled { get; set; }
Property Value
HorizontalChildAlignement
public DrawImageAlignment HorizontalChildAlignement { get; }
Property Value
IsLooped
public bool IsLooped { get; set; }
Property Value
ItemHeight
protected float ItemHeight { get; set; }
Property Value
ItemsSourceCount
public int ItemsSourceCount { get; }
Property Value
LinesColor
public Color LinesColor { get; set; }
Property Value
SelectedIndex
Gets or sets the index of the currently selected item
public int SelectedIndex { get; set; }
Property Value
Use3d
public bool Use3d { get; }
Property Value
UseSpacing
protected float UseSpacing { get; }
Property Value
VisibleCellsCountHalf
protected int VisibleCellsCountHalf { get; }
Property Value
VisibleItemCount
public int VisibleItemCount { get; set; }
Property Value
WheelHalfHeight
protected float WheelHalfHeight { get; }
Property Value
WheelScrollingOffset
public float WheelScrollingOffset { get; set; }
Property Value
WheelVerticalCenter
protected float WheelVerticalCenter { get; }
Property Value
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
requestMeasureRequest
Returns
CheckNeedToSnap()
protected override bool CheckNeedToSnap()
Returns
ClampOffset(float, float, SKRect, bool)
public override Vector2 ClampOffset(float x, float y, SKRect contentOffsetBounds, bool strict = false)
Parameters
Returns
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
contextDrawingContext
GetCellPositionForIndex(int)
public int GetCellPositionForIndex(int index)
Parameters
indexint
Returns
GetIndexAtCellPosition(int)
public int GetIndexAtCellPosition(int position)
Parameters
positionint
Returns
IsIndexValid(int)
public bool IsIndexValid(int position)
Parameters
positionint
Returns
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
Returns
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
newIndexint
PaintSelectionIndicator(DrawingContext)
Draw selection indicator lines if needed
protected virtual void PaintSelectionIndicator(DrawingContext context)
Parameters
contextDrawingContext
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
Returns
- bool
Whether we changed viewport and cache changed
ProcessGestures(SkiaGesturesParameters, GestureEventProcessingInfo)
public override ISkiaGestureListener ProcessGestures(SkiaGesturesParameters args, GestureEventProcessingInfo apply)
Parameters
argsSkiaGesturesParametersapplyGestureEventProcessingInfo
Returns
ScrollToIndex(int, bool, float)
public void ScrollToIndex(int index, bool animated = true, float duration = 0.3)
Parameters
SetContentSize()
protected override void SetContentSize()
Snap(float)
public override void Snap(float maxTimeSecs)
Parameters
maxTimeSecsfloat
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
animatorScrollFlingAnimatorfromfloatvelocityfloat
Returns
Events
SelectedIndexChanged
Event raised when the selected index changes
public event EventHandler<int> SelectedIndexChanged