Table of Contents

Class SkiaDrawer

Namespace
DrawnUi.Controls
Assembly
DrawnUi.Maui.dll
[ContentProperty("Content")]
public class SkiaDrawer : SnappingLayout, INotifyPropertyChanged, IEffectControlProvider, IToolTipElement, IContextFlyoutElement, IAnimatable, IVisualElementController, IElementController, IView, ITransform, IElement, IVisualTreeElement, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISkiaGestureListener, IHasAfterEffects, ISkiaDisposable, ISkiaGridLayout, ISkiaLayout, ISkiaControl, IDrawnBase, ICanBeUpdatedWithContext, ICanBeUpdated, ILayoutInsideViewport, IInsideViewport, IDisposable, IVisibilityAware
Inheritance
SkiaDrawer
Implements
Inherited Members
Extension Methods

Fields

AmplitudeSizeProperty

public static readonly BindableProperty AmplitudeSizeProperty

Field Value

BindableProperty

ChildWasTapped

protected bool ChildWasTapped

Field Value

bool

ContentProperty

public static readonly BindableProperty ContentProperty

Field Value

BindableProperty

DirectionProperty

public static readonly BindableProperty DirectionProperty

Field Value

BindableProperty

HeaderSizeProperty

public static readonly BindableProperty HeaderSizeProperty

Field Value

BindableProperty

IsOpenProperty

public static readonly BindableProperty IsOpenProperty

Field Value

BindableProperty

_panningOffset

protected Vector2 _panningOffset

Field Value

Vector2

Properties

AmplitudeSize

If set to other than -1 will be used instead of HeaderSize for amplitude calculation, amplitude = drawer size - header.

public double AmplitudeSize { get; set; }

Property Value

double

AutoClose

public bool AutoClose { get; set; }

Property Value

bool

CommandClose

Command to close the drawer programmatically. Sets IsOpen to false.

public ICommand CommandClose { get; }

Property Value

ICommand

CommandOpen

Command to open the drawer programmatically. Sets IsOpen to true.

public ICommand CommandOpen { get; }

Property Value

ICommand

CommandToggle

Command to toggle the drawer state programmatically. Inverts the current IsOpen value.

public ICommand CommandToggle { get; }

Property Value

ICommand

Content

public SkiaControl Content { get; set; }

Property Value

SkiaControl

Direction

public DrawerDirection Direction { get; set; }

Property Value

DrawerDirection

HeaderSize

Size of the area that will remain on screen when drawer is closed

public double HeaderSize { get; set; }

Property Value

double

IsOpen

public bool IsOpen { get; set; }

Property Value

bool

IsUserFocused

protected bool IsUserFocused { get; set; }

Property Value

bool

IsUserPanning

protected bool IsUserPanning { get; set; }

Property Value

bool

VelocityAccumulator

protected VelocityAccumulator VelocityAccumulator { get; }

Property Value

VelocityAccumulator

Methods

AdjustCache()

protected void AdjustCache()

ApplyBindingContext()

public override void ApplyBindingContext()

ApplyOptions(bool)

public override void ApplyOptions(bool initialize)

Parameters

initialize bool

ApplyPosition(Vector2)

public override void ApplyPosition(Vector2 position)

Parameters

position Vector2

CheckNeedToSnap()

public bool CheckNeedToSnap()

Returns

bool

ClampOffsetWithRubberBand(float, float)

Called for manual finger panning

protected override Vector2 ClampOffsetWithRubberBand(float x, float y)

Parameters

x float
y float

Returns

Vector2

Close()

public void Close()

GetAutoVelocity(Vector2)

todo calc upon measured size + prop for speed

protected override Vector2 GetAutoVelocity(Vector2 displacement)

Parameters

displacement Vector2

Returns

Vector2

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

GetContentOffsetBounds()

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

public override SKRect GetContentOffsetBounds()

Returns

SKRect

GetOffsetToHide()

In points

protected virtual Vector2 GetOffsetToHide()

Returns

Vector2

OnAppeared()

This event can sometimes be called without prior OnAppearing

public override void OnAppeared()

OnAppearing()

This can sometimes be omitted,

public override void OnAppearing()

OnDisappeared()

public override void OnDisappeared()

OnDisappearing()

public override void OnDisappearing()

OnLayoutChanged()

DrawingRect size changed

protected override void OnLayoutChanged()

OnScrollingStateChanged(bool)

public virtual void OnScrollingStateChanged(bool value)

Parameters

value bool

OnTransitionChanged()

Invokes TransitionChanged event

public override void OnTransitionChanged()

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()

Open()

public void Open()

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

ProcessGestures(SkiaGesturesParameters, GestureEventProcessingInfo)

public override ISkiaGestureListener ProcessGestures(SkiaGesturesParameters args, GestureEventProcessingInfo apply)

Parameters

args SkiaGesturesParameters
apply GestureEventProcessingInfo

Returns

ISkiaGestureListener

SendStateTransitionComplete()

public virtual void SendStateTransitionComplete()

SetContent(SkiaControl)

protected virtual void SetContent(SkiaControl view)

Parameters

view SkiaControl

SetIsOpen()

public void SetIsOpen()

UpdateReportedPosition()

public override void UpdateReportedPosition()

Events

IsOpenChanged

public event EventHandler<bool> IsOpenChanged

Event Type

EventHandler<bool>

StateTransitionComplete

public event EventHandler<bool> StateTransitionComplete

Event Type

EventHandler<bool>

Stopped

public event EventHandler<Vector2> Stopped

Event Type

EventHandler<Vector2>