Class SkiaDrawer
[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
ChildWasTapped
protected bool ChildWasTapped
Field Value
ContentProperty
public static readonly BindableProperty ContentProperty
Field Value
DirectionProperty
public static readonly BindableProperty DirectionProperty
Field Value
HeaderSizeProperty
public static readonly BindableProperty HeaderSizeProperty
Field Value
IsOpenProperty
public static readonly BindableProperty IsOpenProperty
Field Value
_panningOffset
protected Vector2 _panningOffset
Field Value
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
AutoClose
public bool AutoClose { get; set; }
Property Value
CommandClose
Command to close the drawer programmatically. Sets IsOpen to false.
public ICommand CommandClose { get; }
Property Value
CommandOpen
Command to open the drawer programmatically. Sets IsOpen to true.
public ICommand CommandOpen { get; }
Property Value
CommandToggle
Command to toggle the drawer state programmatically. Inverts the current IsOpen value.
public ICommand CommandToggle { get; }
Property Value
Content
public SkiaControl Content { get; set; }
Property Value
Direction
public DrawerDirection Direction { get; set; }
Property Value
HeaderSize
Size of the area that will remain on screen when drawer is closed
public double HeaderSize { get; set; }
Property Value
IsOpen
public bool IsOpen { get; set; }
Property Value
IsUserFocused
protected bool IsUserFocused { get; set; }
Property Value
IsUserPanning
protected bool IsUserPanning { get; set; }
Property Value
VelocityAccumulator
protected VelocityAccumulator VelocityAccumulator { get; }
Property Value
Methods
AdjustCache()
protected void AdjustCache()
ApplyBindingContext()
public override void ApplyBindingContext()
ApplyOptions(bool)
public override void ApplyOptions(bool initialize)
Parameters
initializebool
ApplyPosition(Vector2)
public override void ApplyPosition(Vector2 position)
Parameters
positionVector2
CheckNeedToSnap()
public bool CheckNeedToSnap()
Returns
ClampOffsetWithRubberBand(float, float)
Called for manual finger panning
protected override Vector2 ClampOffsetWithRubberBand(float x, float y)
Parameters
Returns
Close()
public void Close()
GetAutoVelocity(Vector2)
todo calc upon measured size + prop for speed
protected override Vector2 GetAutoVelocity(Vector2 displacement)
Parameters
displacementVector2
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
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
GetOffsetToHide()
In points
protected virtual Vector2 GetOffsetToHide()
Returns
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
valuebool
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
ctxDrawingContext
ProcessGestures(SkiaGesturesParameters, GestureEventProcessingInfo)
public override ISkiaGestureListener ProcessGestures(SkiaGesturesParameters args, GestureEventProcessingInfo apply)
Parameters
argsSkiaGesturesParametersapplyGestureEventProcessingInfo
Returns
SendStateTransitionComplete()
public virtual void SendStateTransitionComplete()
SetContent(SkiaControl)
protected virtual void SetContent(SkiaControl view)
Parameters
viewSkiaControl
SetIsOpen()
public void SetIsOpen()
UpdateReportedPosition()
public override void UpdateReportedPosition()
Events
IsOpenChanged
public event EventHandler<bool> IsOpenChanged
Event Type
StateTransitionComplete
public event EventHandler<bool> StateTransitionComplete
Event Type
Stopped
public event EventHandler<Vector2> Stopped