Class SkiaMauiElement
[ContentProperty("Content")]
public class SkiaMauiElement : SkiaControl, INotifyPropertyChanged, IEffectControlProvider, IToolTipElement, IContextFlyoutElement, IAnimatable, IVisualElementController, IElementController, IView, ITransform, IElement, IVisualTreeElement, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISkiaGestureListener, IHasAfterEffects, ISkiaControl, IDrawnBase, ICanBeUpdatedWithContext, ICanBeUpdated, ISkiaDisposable, IDisposable
- Inheritance
-
SkiaMauiElement
- Implements
- Derived
- Inherited Members
- Extension Methods
Fields
AnimateSnapshotProperty
public static readonly BindableProperty AnimateSnapshotProperty
Field Value
ContentProperty
public static readonly BindableProperty ContentProperty
Field Value
ContentSizeUnits
protected Size ContentSizeUnits
Field Value
FreezeTimeMsProperty
public static readonly BindableProperty FreezeTimeMsProperty
Field Value
TimerShowMauiView
protected RestartingTimer<object> TimerShowMauiView
Field Value
Properties
AnimateSnapshot
Set to true if you are hosting the control inside a scroll or similar case where the control position/transforms are animated fast.
public bool AnimateSnapshot { get; set; }
Property Value
CacheSurfaceInfo
public SKImageInfo CacheSurfaceInfo { get; set; }
Property Value
CachedBitmap
public SKSurface CachedBitmap { get; protected set; }
Property Value
Content
Gets or sets the native MAUI VisualElement to embed within the DrawnUI canvas. This can be any MAUI control like WebView, MediaElement, Entry, Picker, etc. The control will be rendered using platform-specific optimizations.
public VisualElement Content { get; set; }
Property Value
Element
Maui Element to be rendered
public VisualElement Element { get; protected set; }
Property Value
ElementSize
PIXELS, for faster checks
public SKPoint ElementSize { get; set; }
Property Value
FreezeTimeMs
public int FreezeTimeMs { get; set; }
Property Value
IsNativeVisible
public bool IsNativeVisible { get; protected set; }
Property Value
NeedsLayoutNative
public bool NeedsLayoutNative { get; set; }
Property Value
ShowSnapshot
public bool ShowSnapshot { get; }
Property Value
VisualTransformNative
public VisualTransformNative VisualTransformNative { get; protected set; }
Property Value
WasRendered
public bool WasRendered { get; protected set; }
Property Value
Methods
ApplyTransform(VisualTransform)
public void ApplyTransform(VisualTransform transform)
Parameters
transformVisualTransform
CheckChildAdded()
protected virtual void CheckChildAdded()
CreateMauiElement(VisualElement)
public void CreateMauiElement(VisualElement element)
Parameters
elementVisualElement
GetVisualChildren()
For HotReload
public override IReadOnlyList<IVisualTreeElement> GetVisualChildren()
Returns
LayoutMauiElement(bool)
public void LayoutMauiElement(bool manageMainThread = true)
Parameters
manageMainThreadbool
LayoutNativeView(VisualElement)
protected virtual void LayoutNativeView(VisualElement element)
Parameters
elementVisualElement
MeasureAbsolute(SKRect, float)
Measure children inside absolute layout
public override ScaledSize MeasureAbsolute(SKRect rectForChildrenPixels, float scale)
Parameters
Returns
MeasureAndArrangeMauiElement(double, double)
Measure and arrange VisualElement using Maui methods
public virtual Size MeasureAndArrangeMauiElement(double ptsWidth, double ptsHeight)
Parameters
Returns
NativeInvalidate()
public void NativeInvalidate()
OnBindingContextChanged()
First Maui will apply bindings to your controls, then it would call OnBindingContextChanged, so beware on not to break bindings.
protected override void OnBindingContextChanged()
OnChildAdded(SkiaControl)
Prevent usage of subviews as we are using Content property for this control
public override void OnChildAdded(SkiaControl child)
Parameters
childSkiaControl
OnDisposing()
Base performs some cleanup actions with Superview
public override void OnDisposing()
OnFirstDrawn()
protected override void OnFirstDrawn()
OnLayoutChanged()
DrawingRect size changed
protected override void OnLayoutChanged()
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()
PostponeShowingNativeView(int)
protected void PostponeShowingNativeView(int ms)
Parameters
msint
Refresh()
public void Refresh()
Render(DrawingContext)
public override void Render(DrawingContext context)
Parameters
contextDrawingContext
SetChildren(IEnumerable<SkiaControl>)
Prevent usage of subviews as we are using Content property for this control
public override void SetChildren(IEnumerable<SkiaControl> views)
Parameters
viewsIEnumerable<SkiaControl>
SetContent(VisualElement)
Use Content property for direct access
protected virtual void SetContent(VisualElement view)
Parameters
viewVisualElement
SetNativeVisibility(bool)
public virtual void SetNativeVisibility(bool state)
Parameters
statebool
SetVisualTransform(VisualTransform)
Comes after all drawn, actually used by SkiaMauiElement only
public override void SetVisualTransform(VisualTransform transform)
Parameters
transformVisualTransform
SubscribeToRenderingChain(bool)
protected void SubscribeToRenderingChain(bool subscribe)
Parameters
subscribebool
SuperViewChanged()
public override void SuperViewChanged()