Table of Contents

Class DrawnView

Namespace
DrawnUi.Views
Assembly
DrawnUi.Maui.dll
public class DrawnView : ContentView, INotifyPropertyChanged, IEffectControlProvider, IToolTipElement, IContextFlyoutElement, IAnimatable, IViewController, IVisualElementController, IElementController, IGestureController, IGestureRecognizers, IPropertyMapperView, IHotReloadableView, IReplaceableView, ILayout, ILayoutController, IContentView, IView, IElement, ITransform, IPadding, ICrossPlatformLayout, IDrawnBase, IDisposable, ICanBeUpdatedWithContext, ICanBeUpdated, IAnimatorsManager, IVisualTreeElement, IDisposeManager, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable
Inheritance
DrawnView
Implements
Derived
Inherited Members
Extension Methods

Constructors

DrawnView()

public DrawnView()

Fields

CallbackScreenshot

protected Action<SKImage> CallbackScreenshot

Field Value

Action<SKImage>

CanRenderOffScreenProperty

public static readonly BindableProperty CanRenderOffScreenProperty

Field Value

BindableProperty

ClipEffectsProperty

public static readonly BindableProperty ClipEffectsProperty

Field Value

BindableProperty

Diagnostics

public DrawnView.DiagnosticData Diagnostics

Field Value

DrawnView.DiagnosticData

DirtyChildrenTracker

protected ConcurrentDictionary<Guid, SkiaControl> DirtyChildrenTracker

Field Value

ConcurrentDictionary<Guid, SkiaControl>

FrameTimeInterpolator

protected FrameTimeInterpolator FrameTimeInterpolator

Field Value

FrameTimeInterpolator

InvalidationActionsA

protected readonly Dictionary<Action, SkiaControl> InvalidationActionsA

Field Value

Dictionary<Action, SkiaControl>

InvalidationActionsB

protected readonly Dictionary<Action, SkiaControl> InvalidationActionsB

Field Value

Dictionary<Action, SkiaControl>

LastDrawnRect

protected SKRect LastDrawnRect

Field Value

SKRect

LastFrameTimeNanos

protected long LastFrameTimeNanos

Field Value

long

LockDraw

protected object LockDraw

Field Value

object

LockIterateListeners

protected object LockIterateListeners

Field Value

object

LockStartOffscreenQueue

protected object LockStartOffscreenQueue

Field Value

object

OrientationProperty

public static readonly BindableProperty OrientationProperty

Field Value

BindableProperty

RenderingModeProperty

public static readonly BindableProperty RenderingModeProperty

Field Value

BindableProperty

RenderingScaleProperty

public static readonly BindableProperty RenderingScaleProperty

Field Value

BindableProperty

RenderingSubscribers

For native controls over Canvas to be notified after every of their position

public Dictionary<SkiaControl, bool> RenderingSubscribers

Field Value

Dictionary<SkiaControl, bool>

UpdateLocksProperty

public static readonly BindableProperty UpdateLocksProperty

Field Value

BindableProperty

UpdateModeProperty

public static readonly BindableProperty UpdateModeProperty

Field Value

BindableProperty

Value1Property

public static readonly BindableProperty Value1Property

Field Value

BindableProperty

Value2Property

public static readonly BindableProperty Value2Property

Field Value

BindableProperty

Value3Property

public static readonly BindableProperty Value3Property

Field Value

BindableProperty

Value4Property

public static readonly BindableProperty Value4Property

Field Value

BindableProperty

_fps

protected double _fps

Field Value

double

semaphoreOffscreenProcess

protected SemaphoreSlim semaphoreOffscreenProcess

Field Value

SemaphoreSlim

Properties

AnimatingControls

Tracking controls that what to be animated right now so we constantly refresh canvas until there is none left

public ConcurrentDictionary<Guid, ISkiaAnimator> AnimatingControls { get; }

Property Value

ConcurrentDictionary<Guid, ISkiaAnimator>

AvailableDestination

public SKRect AvailableDestination { get; set; }

Property Value

SKRect

CanDraw

Indicates that it is allowed to be rendered by engine, internal use. Will check IsHiddenInViewTree.

public bool CanDraw { get; }

Property Value

bool

CanRender

Underlying surface and engine are ready to render

public bool CanRender { get; }

Property Value

bool

CanRenderOffScreen

If this is check you view will be refreshed even off-screen or hidden

public bool CanRenderOffScreen { get; set; }

Property Value

bool

CanvasFps

Actual FPS

public double CanvasFps { get; }

Property Value

double

CanvasView

public ISkiaDrawable CanvasView { get; protected set; }

Property Value

ISkiaDrawable

Children

public IList<SkiaControl> Children { get; set; }

Property Value

IList<SkiaControl>

ClipEffects

public bool ClipEffects { get; set; }

Property Value

bool

Clipping

public Action<SKPath, SKRect> Clipping { get; set; }

Property Value

Action<SKPath, SKRect>

Count

Gets the number of elements contained in the ICollection<T>.

public int Count { get; }

Property Value

int

The number of elements contained in the ICollection<T>.

Delayed

protected Grid Delayed { get; set; }

Property Value

Grid

Destination

public SKRect Destination { get; protected set; }

Property Value

SKRect

DisposeManager

protected DisposableManager DisposeManager { get; }

Property Value

DisposableManager

DrawingRect

public SKRect DrawingRect { get; }

Property Value

SKRect

DrawingThreadId

Can use this to manage double buffering to detect if we are in the drawing thread or in background.

public int DrawingThreadId { get; protected set; }

Property Value

int

DrawingThreads

For debugging purposes check if dont have concurrent threads

public int DrawingThreads { get; protected set; }

Property Value

int

ExecuteAfterDraw

public Queue<Action> ExecuteAfterDraw { get; }

Property Value

Queue<Action>

ExecuteBeforeDraw

public KeyedActionQueue<long> ExecuteBeforeDraw { get; }

Property Value

KeyedActionQueue<long>

FPS

Average FPS

public double FPS { get; protected set; }

Property Value

double

FocusLocked

public bool FocusLocked { get; set; }

Property Value

bool

FocusedChild

Is set upon the consumer of the DOWN gesture. Calls ReportFocus methos when set.

public ISkiaGestureListener FocusedChild { get; set; }

Property Value

ISkiaGestureListener

FrameNumber

public long FrameNumber { get; }

Property Value

long

FrameTime

Frame started rendering nanoseconds

public long FrameTime { get; protected set; }

Property Value

long

GestureListeners

Children we should check for touch hits

public SortedGestureListeners GestureListeners { get; }

Property Value

SortedGestureListeners

HasHandler

public bool HasHandler { get; set; }

Property Value

bool

InvalidatedCanvas

A very important tracking prop to avoid saturating main thread with too many updates

protected long InvalidatedCanvas { get; set; }

Property Value

long

IsDirty

public bool IsDirty { get; set; }

Property Value

bool

IsDisposed

public bool IsDisposed { get; protected set; }

Property Value

bool

IsDisposing

public bool IsDisposing { get; set; }

Property Value

bool

IsGhost

public bool IsGhost { get; set; }

Property Value

bool

IsHiddenInViewTree

Indicates that view is either hidden or offscreen. This disables rendering. If you don't set CanRenderOffScreen to true

public bool IsHiddenInViewTree { get; set; }

Property Value

bool

IsReadOnly

Gets a value indicating whether the ICollection<T> is read-only.

public bool IsReadOnly { get; }

Property Value

bool

true if the ICollection<T> is read-only; otherwise, false.

IsRendering

public bool IsRendering { get; protected set; }

Property Value

bool

IsUsingHardwareAcceleration

public bool IsUsingHardwareAcceleration { get; }

Property Value

bool

this[int]

Gets or sets the element at the specified index.

public IView this[int index] { get; set; }

Parameters

index int

The zero-based index of the element to get or set.

Property Value

IView

The element at the specified index.

Exceptions

ArgumentOutOfRangeException

index is not a valid index in the IList<T>.

NotSupportedException

The property is set and the IList<T> is read-only.

MeasuredSize

public ScaledSize MeasuredSize { get; set; }

Property Value

ScaledSize

NeedAutoHeight

public bool NeedAutoHeight { get; }

Property Value

bool

NeedAutoSize

public bool NeedAutoSize { get; }

Property Value

bool

NeedAutoWidth

public bool NeedAutoWidth { get; }

Property Value

bool

NeedCheckParentVisibility

public bool NeedCheckParentVisibility { get; set; }

Property Value

bool

NeedGlobalRefreshCount

public long NeedGlobalRefreshCount { get; set; }

Property Value

long

NeedMeasure

The virtual view needs native measurement

protected virtual bool NeedMeasure { get; set; }

Property Value

bool

NeedMeasureDrawn

Underlying drawn views need measurement

protected bool NeedMeasureDrawn { get; set; }

Property Value

bool

NeedRedraw

public bool NeedRedraw { get; set; }

Property Value

bool

Orientation

public DeviceOrientation Orientation { get; set; }

Property Value

DeviceOrientation

PaintSystem

protected SKPaint PaintSystem { get; set; }

Property Value

SKPaint

PostAnimators

Executed after the rendering

public List<IOverlayEffect> PostAnimators { get; }

Property Value

List<IOverlayEffect>

RenderingMode

Whether is using hardware acceleration or software rendering

public RenderingModeType RenderingMode { get; set; }

Property Value

RenderingModeType

RenderingScale

public float RenderingScale { get; set; }

Property Value

float

ShouldInvalidateByChildren

public virtual bool ShouldInvalidateByChildren { get; }

Property Value

bool

StopDrawingWhenUpdateIsLocked

Set this to true if you do not want the canvas to be redrawn as transparent and showing content below the canvas (splash?..) when UpdateLocks is True

public bool StopDrawingWhenUpdateIsLocked { get; set; }

Property Value

bool

SurfaceCacheManager

protected SurfaceCacheManager SurfaceCacheManager { get; set; }

Property Value

SurfaceCacheManager

Tag

public string Tag { get; set; }

Property Value

string

TimeDrawingComplete

public DateTime TimeDrawingComplete { get; protected set; }

Property Value

DateTime

TimeDrawingStarted

public DateTime TimeDrawingStarted { get; protected set; }

Property Value

DateTime

Uid

public Guid Uid { get; }

Property Value

Guid

UpdateLocks

public int UpdateLocks { get; set; }

Property Value

int

UpdateMode

public UpdateMode UpdateMode { get; set; }

Property Value

UpdateMode

Value1

public double Value1 { get; set; }

Property Value

double

Value2

public double Value2 { get; set; }

Property Value

double

Value3

public double Value3 { get; set; }

Property Value

double

Value4

public double Value4 { get; set; }

Property Value

double

Views

For code-behind access of children, XAML is using Children property

public List<SkiaControl> Views { get; }

Property Value

List<SkiaControl>

WasRendered

public bool WasRendered { get; set; }

Property Value

bool

mLastFrameTime

public long mLastFrameTime { get; set; }

Property Value

long

Methods

Add(IView)

Adds an item to the ICollection<T>.

public void Add(IView item)

Parameters

item IView

The object to add to the ICollection<T>.

Exceptions

NotSupportedException

The ICollection<T> is read-only.

AddAnimator(ISkiaAnimator)

public void AddAnimator(ISkiaAnimator animator)

Parameters

animator ISkiaAnimator

AddOrRemoveView(SkiaControl, bool)

protected void AddOrRemoveView(SkiaControl subView, bool add)

Parameters

subView SkiaControl
add bool

AddSubView(SkiaControl)

Directly adds a view to the control, without any layouting. Use this instead of Views.Add() to avoid memory leaks etc

public void AddSubView(SkiaControl control)

Parameters

control SkiaControl

Arrange(SKRect, double, double, double)

destination in PIXELS, requests in UNITS. resulting Destination prop will be filed in PIXELS.

public virtual void Arrange(SKRect destination, double widthRequest, double heightRequest, double scale = 1)

Parameters

destination SKRect

PIXELS

widthRequest double

UNITS

heightRequest double

UNITS

scale double

CalculateLayout(SKRect, double, double, double)

destination in PIXELS, requests in UNITS. resulting Destination prop will be filed in PIXELS.

public SKRect CalculateLayout(SKRect destination, double widthRequest, double heightRequest, double scale = 1)

Parameters

destination SKRect

PIXELS

widthRequest double

UNITS

heightRequest double

UNITS

scale double

Returns

SKRect

CheckElementVisibility(VisualElement)

public void CheckElementVisibility(VisualElement element)

Parameters

element VisualElement

Clear()

Removes all items from the ICollection<T>.

public virtual void Clear()

Exceptions

NotSupportedException

The ICollection<T> is read-only.

ClearChildren()

public virtual void ClearChildren()

ClipSmart(SKCanvas, SKPath, SKClipOperation)

Clip using internal custom settings of the control

public virtual void ClipSmart(SKCanvas canvas, SKPath path, SKClipOperation operation = SKClipOperation.Intersect)

Parameters

canvas SKCanvas
path SKPath
operation SKClipOperation

CommitInvalidations()

protected void CommitInvalidations()

ConnectedHandler()

public virtual void ConnectedHandler()

Contains(IView)

Determines whether the ICollection<T> contains a specific value.

public bool Contains(IView item)

Parameters

item IView

The object to locate in the ICollection<T>.

Returns

bool

true if item is found in the ICollection<T>; otherwise, false.

CopyTo(IView[], int)

Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.

public void CopyTo(IView[] array, int arrayIndex)

Parameters

array IView[]

The one-dimensional Array that is the destination of the elements copied from ICollection<T>. The Array must have zero-based indexing.

arrayIndex int

The zero-based index in array at which copying begins.

Exceptions

ArgumentNullException

array is null.

ArgumentOutOfRangeException

arrayIndex is less than 0.

ArgumentException

The number of elements in the source ICollection<T> is greater than the available space from arrayIndex to the end of the destination array.

CreateClip(object, bool, SKPath)

Creates a new disposable SKPath for clipping content according to the control shape and size. Create this control clip for painting content. Pass arguments if you want to use some time-frozen data for painting at any time from any thread.. If applyPosition is false will create clip without using drawing posiition, like if was drawing at 0,0.

public virtual SKPath CreateClip(object arguments, bool usePosition, SKPath path = null)

Parameters

arguments object
usePosition bool
path SKPath

Returns

SKPath

CreateContext(SKSurface)

protected virtual SkiaDrawingContext CreateContext(SKSurface surface)

Parameters

surface SKSurface

Returns

SkiaDrawingContext

CreateSkiaView()

Will safely destroy existing if any

protected void CreateSkiaView()

CreateSurface(int, int, bool)

public SKSurface CreateSurface(int width, int height, bool isGpu)

Parameters

width int
height int
isGpu bool

Returns

SKSurface

DestroySkiaView()

protected void DestroySkiaView()

DisconnectedHandler()

public virtual void DisconnectedHandler()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

DisposeObject(IDisposable, string)

public void DisposeObject(IDisposable resource, string caller = null)

Parameters

resource IDisposable
caller string

Draw(DrawingContext)

protected virtual void Draw(DrawingContext context)

Parameters

context DrawingContext

DumpLayersTree(VisualLayer, string, bool, int)

public void DumpLayersTree(VisualLayer node, string prefix = "", bool isLast = true, int level = 0)

Parameters

node VisualLayer
prefix string
isLast bool
level int

ExecuteAnimators(long)

protected int ExecuteAnimators(long frameTime)

Parameters

frameTime long

Returns

int

ExecutePostAnimators(DrawingContext)

public int ExecutePostAnimators(DrawingContext context)

Parameters

context DrawingContext

Returns

int

~DrawnView()

protected ~DrawnView()

FixDensity()

protected void FixDensity()

GetBackInvalidations()

protected Dictionary<Action, SkiaControl> GetBackInvalidations()

Returns

Dictionary<Action, SkiaControl>

GetDensity()

public static double GetDensity()

Returns

double

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<IView> GetEnumerator()

Returns

IEnumerator<IView>

An enumerator that can be used to iterate through the collection.

GetFrontInvalidations()

protected Dictionary<Action, SkiaControl> GetFrontInvalidations()

Returns

Dictionary<Action, SkiaControl>

GetGRContext()

public GRContext GetGRContext()

Returns

GRContext

GetIsVisibleWithParent(VisualElement)

public bool GetIsVisibleWithParent(VisualElement element)

Parameters

element VisualElement

Returns

bool

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 virtual ScaledRect GetOnScreenVisibleArea(DrawingContext context, Vector2 inflateByPixels = default)

Parameters

context DrawingContext
inflateByPixels Vector2

Returns

ScaledRect

GetOrderedSubviews()

For non templated simple subviews

public IReadOnlyList<SkiaControl> GetOrderedSubviews()

Returns

IReadOnlyList<SkiaControl>

IndexOf(IView)

Determines the index of a specific item in the IList<T>.

public int IndexOf(IView item)

Parameters

item IView

The object to locate in the IList<T>.

Returns

int

The index of item if found in the list; otherwise, -1.

InitFramework(bool)

protected virtual void InitFramework(bool subscribe)

Parameters

subscribe bool

Insert(int, IView)

Inserts an item to the IList<T> at the specified index.

public void Insert(int index, IView item)

Parameters

index int

The zero-based index at which item should be inserted.

item IView

The object to insert into the IList<T>.

Exceptions

ArgumentOutOfRangeException

index is not a valid index in the IList<T>.

NotSupportedException

The IList<T> is read-only.

Invalidate()

Makes the control dirty, in need to be remeasured and rendered but this doesn't call Update, it's up yo you

public virtual void Invalidate()

InvalidateByChild(SkiaControl)

This is needed by layout to track which child changed to sometimes avoid recalculating other children

public virtual void InvalidateByChild(SkiaControl child)

Parameters

child SkiaControl

InvalidateCanvas()

[Obsolete("Used by Update() when Super.UseLegacyLoop is True")]
protected void InvalidateCanvas()

InvalidateChildren()

We need to invalidate children maui changed our storyboard size

public void InvalidateChildren()

InvalidateParents()

If need the re-measure all parents because child-auto-size has changed

public void InvalidateParents()

InvalidateViewport()

public virtual void InvalidateViewport()

InvalidateViewsList()

To make GetOrderedSubviews() regenerate next result instead of using cached

public void InvalidateViewsList()

IsRootView(float, float, SKRect)

public bool IsRootView(float width, float height, SKRect destination)

Parameters

width float
height float
destination SKRect

Returns

bool

IsVisibleInViewTree()

public virtual bool IsVisibleInViewTree()

Returns

bool

KickOffscreenCacheRendering()

Ensures offscreen rendering queue is running

public void KickOffscreenCacheRendering()

LinearGradientAngleToPoints(double)

public static (double X1, double Y1, double X2, double Y2) LinearGradientAngleToPoints(double direction)

Parameters

direction double

Returns

(double X1, double Y1, double X2, double Y2)

Measure(float, float)

public virtual ScaledSize Measure(float widthConstraintPts, float heightConstraintPts)

Parameters

widthConstraintPts float
heightConstraintPts float

Returns

ScaledSize

NeedInvalidateCanvas(BindableObject, object, object)

protected static void NeedInvalidateCanvas(BindableObject bindable, object oldvalue, object newvalue)

Parameters

bindable BindableObject
oldvalue object
newvalue object

OnBindingContextChanged()

Invoked whenever the binding context of the View changes.

protected override void OnBindingContextChanged()

Remarks

This method can be overridden to add class handling for this event. Overrides must call the base method.

OnCanRenderChanged(bool)

Invoked when IsHiddenInViewTree changes

public virtual void OnCanRenderChanged(bool state)

Parameters

state bool

OnCanvasViewChanged()

public virtual void OnCanvasViewChanged()

OnChangingtIsHiddenInViewTree(bool)

WIll set value, indicates that view is either hidden or offscreen. This disables rendering if CanRenderOffScreen is false. You can override this for a specific view to not stop rendering even if it is hidden in view tree, for example for debugging purposes or if you want to render something only on screen shot or something like that.

protected virtual bool OnChangingtIsHiddenInViewTree(bool value)

Parameters

value bool

Returns

bool

OnChildAdded(SkiaControl)

protected virtual void OnChildAdded(SkiaControl child)

Parameters

child SkiaControl

OnChildRemoved(SkiaControl)

protected virtual void OnChildRemoved(SkiaControl child)

Parameters

child SkiaControl

OnDensityChanged()

public virtual void OnDensityChanged()

OnDestroyingVew()

protected virtual void OnDestroyingVew()

OnDispose()

public virtual void OnDispose()

OnDisposing()

public virtual void OnDisposing()

OnFinalizeRendering()

protected virtual void OnFinalizeRendering()

OnHandlerChanged()

When overridden in a derived class, should raise the HandlerChanged event.

protected override void OnHandlerChanged()

Remarks

It is the implementor's responsibility to raise the HandlerChanged event.

OnHandlerChanging(HandlerChangingEventArgs)

When overridden in a derived class, should raise the HandlerChanging event.

protected override void OnHandlerChanging(HandlerChangingEventArgs args)

Parameters

args HandlerChangingEventArgs

Provides data for the HandlerChanging event.

Remarks

It is the implementor's responsibility to raise the HandlerChanging event.

OnHotReload()

public virtual void OnHotReload()

OnMeasured()

protected virtual void OnMeasured()

OnParentSet()

Raises the (internal) ParentSet event.

protected override void OnParentSet()

Remarks

Will set the NavigationProxy's inner navigation object to closest topmost element capable of handling navigation calls.

See Also

OnPropertyChanged(string)

Method that is called when a bound property is changed.

protected override void OnPropertyChanged(string propertyName = null)

Parameters

propertyName string

The name of the bound property that changed.

OnSizeChanged()

protected virtual void OnSizeChanged()

OnStartRendering(SKCanvas)

protected virtual bool OnStartRendering(SKCanvas canvas)

Parameters

canvas SKCanvas

Returns

bool

OnSuperviewShouldRenderChanged(bool)

public virtual void OnSuperviewShouldRenderChanged(bool state)

Parameters

state bool

PaintTintBackground(SKCanvas)

public virtual void PaintTintBackground(SKCanvas canvas)

Parameters

canvas SKCanvas

PostponeExecutionAfterDraw(Action)

Postpone the action to be executed after the current frame is drawn. Exception-safe.

public void PostponeExecutionAfterDraw(Action action)

Parameters

action Action

PostponeExecutionBeforeDraw(Action, long)

Postpone the action to be executed before the next frame being drawn. Exception-safe.

public void PostponeExecutionBeforeDraw(Action action, long key)

Parameters

action Action
key long

PostponeInvalidation(SkiaControl, Action)

public void PostponeInvalidation(SkiaControl key, Action action)

Parameters

key SkiaControl
action Action

PrintDebug(string)

public void PrintDebug(string indent = "")

Parameters

indent string

ProcessOffscreenCacheRenderingAsync()

public Task ProcessOffscreenCacheRenderingAsync()

Returns

Task

PushToOffscreenRendering(SkiaControl, CancellationToken)

Push an offscreen rendering command without blocking the UI thread.

public void PushToOffscreenRendering(SkiaControl control, CancellationToken cancel = default)

Parameters

control SkiaControl
cancel CancellationToken

RedrawCanvas(BindableObject, object, object)

protected static void RedrawCanvas(BindableObject bindable, object oldvalue, object newvalue)

Parameters

bindable BindableObject
oldvalue object
newvalue object

RegisterAnimator(ISkiaAnimator)

Called by a control that whats to be constantly animated or doesn't anymore, so we know whether we should refresh canvas non-stop

public bool RegisterAnimator(ISkiaAnimator animator)

Parameters

animator ISkiaAnimator

Returns

bool

RegisterGestureListener(ISkiaGestureListener)

public void RegisterGestureListener(ISkiaGestureListener gestureListener)

Parameters

gestureListener ISkiaGestureListener

Remove(IView)

Removes the first occurrence of a specific object from the ICollection<T>.

public bool Remove(IView item)

Parameters

item IView

The object to remove from the ICollection<T>.

Returns

bool

true if item was successfully removed from the ICollection<T>; otherwise, false. This method also returns false if item is not found in the original ICollection<T>.

Exceptions

NotSupportedException

The ICollection<T> is read-only.

RemoveAnimator(Guid)

public void RemoveAnimator(Guid uid)

Parameters

uid Guid

RemoveAt(int)

Removes the IList<T> item at the specified index.

public void RemoveAt(int index)

Parameters

index int

The zero-based index of the item to remove.

Exceptions

ArgumentOutOfRangeException

index is not a valid index in the IList<T>.

NotSupportedException

The IList<T> is read-only.

RemoveSubView(SkiaControl)

Directly removes a view from the control, without any layouting. Use this instead of Views.Remove() to avoid memory leaks etc

public void RemoveSubView(SkiaControl control)

Parameters

control SkiaControl

Repaint()

public virtual void Repaint()

ReportFocus(ISkiaGestureListener, ISkiaGestureListener)

Internal call by control, after reporting will affect FocusedChild but will not get FocusedItemChanged as it was its own call

public void ReportFocus(ISkiaGestureListener value, ISkiaGestureListener setter = null)

Parameters

value ISkiaGestureListener
setter ISkiaGestureListener

ReportHotreloadChildAdded(SkiaControl)

public virtual void ReportHotreloadChildAdded(SkiaControl child)

Parameters

child SkiaControl

ReportHotreloadChildRemoved(SkiaControl)

public virtual void ReportHotreloadChildRemoved(SkiaControl control)

Parameters

control SkiaControl

ResetFocusWithDelay(int)

public void ResetFocusWithDelay(int ms)

Parameters

ms int

ResetUpdate()

public void ResetUpdate()

ReturnSurface(SKSurface)

DO NOT call this for GPU surfaces use DisposeObject instead

public void ReturnSurface(SKSurface surface)

Parameters

surface SKSurface

SetChildAsDirty(SkiaControl)

public void SetChildAsDirty(SkiaControl child)

Parameters

child SkiaControl

SetChildren(IEnumerable<SkiaControl>)

public virtual void SetChildren(IEnumerable<SkiaControl> views)

Parameters

views IEnumerable<SkiaControl>

SetDeviceOrientation(DeviceOrientation)

public void SetDeviceOrientation(DeviceOrientation value)

Parameters

value DeviceOrientation

SetMeasured(float, float, float)

protected ScaledSize SetMeasured(float width, float height, float scale)

Parameters

width float
height float
scale float

Returns

ScaledSize

SetPauseStateOfAllAnimatorsByParent(SkiaControl, bool)

public virtual IEnumerable<ISkiaAnimator> SetPauseStateOfAllAnimatorsByParent(SkiaControl parent, bool state)

Parameters

parent SkiaControl
state bool

Returns

IEnumerable<ISkiaAnimator>

SetViewTreeVisibilityByParent(SkiaControl, bool)

TODO maybe use renderedNode tree

public virtual IEnumerable<ISkiaAnimator> SetViewTreeVisibilityByParent(SkiaControl parent, bool state)

Parameters

parent SkiaControl
state bool

Returns

IEnumerable<ISkiaAnimator>

StreamFromString(string)

public static MemoryStream StreamFromString(string value)

Parameters

value string

Returns

MemoryStream

SubscribeToRenderingFinished(SkiaControl)

SetVisualTransform will be called after every frame

public void SubscribeToRenderingFinished(SkiaControl control)

Parameters

control SkiaControl

SwapInvalidations()

protected void SwapInvalidations()

TakeScreenShot(Action<SKImage>)

public void TakeScreenShot(Action<SKImage> callback)

Parameters

callback Action<SKImage>

TakeScreenShotInternal(SKSurface)

protected virtual void TakeScreenShotInternal(SKSurface surface)

Parameters

surface SKSurface

UnregisterAllAnimatorsByParent(SkiaControl)

public virtual IEnumerable<ISkiaAnimator> UnregisterAllAnimatorsByParent(SkiaControl parent)

Parameters

parent SkiaControl

Returns

IEnumerable<ISkiaAnimator>

UnregisterAllAnimatorsByType(Type)

public virtual IEnumerable<ISkiaAnimator> UnregisterAllAnimatorsByType(Type type)

Parameters

type Type

Returns

IEnumerable<ISkiaAnimator>

UnregisterAnimator(Guid)

public void UnregisterAnimator(Guid uid)

Parameters

uid Guid

UnregisterGestureListener(ISkiaGestureListener)

public void UnregisterGestureListener(ISkiaGestureListener gestureListener)

Parameters

gestureListener ISkiaGestureListener

Update()

Force redrawing, without invalidating the measured size

public virtual void Update()

UpdateByChild(SkiaControl)

To track dirty area when Updating parent

public virtual void UpdateByChild(SkiaControl child)

Parameters

child SkiaControl

UpdateGlobal()

protected virtual void UpdateGlobal()

UsubscribeFromRenderingFinished(SkiaControl)

public void UsubscribeFromRenderingFinished(SkiaControl control)

Parameters

control SkiaControl

WillDispose()

protected virtual void WillDispose()

Events

FocusedItemChanged

public event EventHandler<DrawnView.FocusedItemChangedArgs> FocusedItemChanged

Event Type

EventHandler<DrawnView.FocusedItemChangedArgs>

HandlerWasSet

public event EventHandler<bool> HandlerWasSet

Event Type

EventHandler<bool>

Measured

public event EventHandler<ScaledSize> Measured

Event Type

EventHandler<ScaledSize>

OrientationChanged

public event EventHandler<DeviceOrientation> OrientationChanged

Event Type

EventHandler<DeviceOrientation>

ViewDisposing

public event EventHandler ViewDisposing

Event Type

EventHandler

WasDrawn

OnDrawSurface will call that

public event EventHandler<SkiaDrawingContext?> WasDrawn

Event Type

EventHandler<SkiaDrawingContext>

WillDraw

OnDrawSurface will call that

public event EventHandler<SkiaDrawingContext?> WillDraw

Event Type

EventHandler<SkiaDrawingContext>

WillFirstTimeDraw

OnDrawSurface will call that if never been drawn yet

public event EventHandler<SkiaDrawingContext?> WillFirstTimeDraw

Event Type

EventHandler<SkiaDrawingContext>