Table of Contents

Class FluentExtensions

Namespace
DrawnUi.Draw
Assembly
DrawnUi.Maui.dll

Provides extension methods for fluent API design pattern with DrawnUI controls

public static class FluentExtensions
Inheritance
FluentExtensions
Inherited Members

Methods

Adapt<T>(T, Action<T>)

Performs an action on the control and returns it to continue the fluent chain

public static T Adapt<T>(this T view, Action<T> action) where T : SkiaControl

Parameters

view T

The control to act upon

action Action<T>

The action to perform

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

AssignNative<T>(T, out T)

public static T AssignNative<T>(this T control, out T variable) where T : VisualElement

Parameters

control T
variable T

Returns

T

Type Parameters

T

AssignParent<T>(T, SkiaControl)

Assigns the control to a parent and returns the control for fluent chaining.

public static T AssignParent<T>(this T control, SkiaControl parent) where T : SkiaControl

Parameters

control T

The control to assign

parent SkiaControl

The parent control to add to

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

Assign<T>(T, out T)

Assigns the control to a variable and returns the control to continue the fluent chain

public static T Assign<T>(this T control, out T variable) where T : BindableObject

Parameters

control T

The control to assign

variable T

The out variable to store the reference

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

BindProperty<T>(T, BindableProperty, INotifyPropertyChanged, string, BindingMode)

Binds a property of a view to a source property using a specified path and binding mode.

public static T BindProperty<T>(this T view, BindableProperty targetProperty, INotifyPropertyChanged source, string path, BindingMode mode = BindingMode.Default) where T : SkiaControl

Parameters

view T

The UI element that will have its property bound to a source property.

targetProperty BindableProperty

The property of the view that will receive the binding.

source INotifyPropertyChanged

The object that implements property change notifications and serves as the data source.

path string

The path to the property on the source object that will be bound to the target property.

mode BindingMode

Specifies the binding mode, determining how the source and target properties interact.

Returns

T

Returns the view after setting up the binding.

Type Parameters

T

Represents a type that extends SkiaControl, allowing for binding operations on UI elements.

BindProperty<T>(T, BindableProperty, string, BindingMode)

Sets up a simple non-compiled binding for a property

public static T BindProperty<T>(this T view, BindableProperty property, string path, BindingMode mode = BindingMode.Default) where T : SkiaControl

Parameters

view T

The control to set the binding for

property BindableProperty
path string

The binding path

mode BindingMode

The binding mode

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

BindProperty<T, TProperty>(T, BindableProperty, string, IValueConverter, object, BindingMode)

Sets up a simple binding for a property with a converter

public static T BindProperty<T, TProperty>(this T view, BindableProperty targetProperty, string path, IValueConverter converter, object converterParameter = null, BindingMode mode = BindingMode.Default) where T : SkiaControl

Parameters

view T

The control to set the binding for

targetProperty BindableProperty

The target property

path string

The binding path

converter IValueConverter

The value converter

converterParameter object

The converter parameter

mode BindingMode

The binding mode

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

TProperty

Type of the property

CenterX<T>(T)

Sets the control's horizontal options to center

public static T CenterX<T>(this T view) where T : SkiaControl

Parameters

view T

The control to center horizontally

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

CenterY<T>(T)

Sets the control's vertical options to center

public static T CenterY<T>(this T view) where T : SkiaControl

Parameters

view T

The control to center vertically

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

Center<T>(T)

Centers the control both horizontally and vertically

public static T Center<T>(this T view) where T : SkiaControl

Parameters

view T

The control to center

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

EndX<T>(T)

public static T EndX<T>(this T view) where T : SkiaControl

Parameters

view T

Returns

T

Type Parameters

T

EndY<T>(T)

public static T EndY<T>(this T view) where T : SkiaControl

Parameters

view T

Returns

T

Type Parameters

T

FillX<T>(T)

Fills horizontally

public static T FillX<T>(this T view) where T : SkiaControl

Parameters

view T

Returns

T

Type Parameters

T

FillY<T>(T)

Fills vertically

public static T FillY<T>(this T view) where T : SkiaControl

Parameters

view T

Returns

T

Type Parameters

T

Fill<T>(T)

Fills in both directions

public static T Fill<T>(this T view) where T : SkiaControl

Parameters

view T

Returns

T

Type Parameters

T

Initialize<T>(T, Action<T>)

Registers a callback to be executed after the control is added to the view tree and initialized. Use for setup that requires the control to be part of the visual tree. This is called after the control default content was created and all variables have been assigned inside the fluent chain.

public static T Initialize<T>(this T view, Action<T> action) where T : SkiaControl

Parameters

view T

The control to initialize

action Action<T>

Initialization logic to run

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

ObserveBindingContextOn<T, TTarget, TSource>(T, TTarget, Action<T, TTarget, TSource, string>, bool)

Watches for property changes on another control's BindingContext of type TSource.

public static T ObserveBindingContextOn<T, TTarget, TSource>(this T control, TTarget target, Action<T, TTarget, TSource, string> callback, bool debugTypeMismatch = true) where T : SkiaControl where TTarget : SkiaControl where TSource : INotifyPropertyChanged

Parameters

control T

The control to extend

target TTarget

The target control whose BindingContext to watch

callback Action<T, TTarget, TSource, string>

Callback executed when properties change, receiving the control, the target control, the typed BindingContext, and the property name

debugTypeMismatch bool

Whether to log a warning when the actual BindingContext type doesn't match TSource (default: true)

Returns

T

The original control for chaining

Type Parameters

T

Type of the control being extended

TTarget

Type of the target control whose BindingContext we're watching

TSource

Expected type of the target control's BindingContext

Remarks

This method handles two scenarios:

  1. The target's BindingContext is already set when the method is called
  2. The target's BindingContext will be set sometime after the method is called

ObserveBindingContext<T, TSource>(T, Action<T, TSource, string>, bool)

Watches for property changes on the control's BindingContext of type TSource. Works with both immediate and delayed BindingContext assignment scenarios.

public static T ObserveBindingContext<T, TSource>(this T control, Action<T, TSource, string> callback, bool debugTypeMismatch = true) where T : SkiaControl where TSource : INotifyPropertyChanged

Parameters

control T

The control to watch

callback Action<T, TSource, string>

Callback executed when properties change, receiving the control, the typed BindingContext, and the property name

debugTypeMismatch bool

Whether to log a warning when the actual BindingContext type doesn't match TSource (default: true)

Returns

T

The control for chaining

Type Parameters

T

Type of the control

TSource

Expected type of the BindingContext

Remarks

This method handles two scenarios:

  1. The BindingContext is already set when the method is called
  2. The BindingContext will be set sometime after the method is called

The callback will be invoked immediately after subscription with an empty property name, allowing initialization based on the current state.

ObserveOn<T, TParent, TTarget>(T, TParent, Func<TTarget>, string, Action<T, string>, string[])

Observes a dynamically resolved target object using a function selector. When the parent's properties change, re-evaluates the selector and automatically unsubscribes from old target and subscribes to new one. AOT-compatible.

public static T ObserveOn<T, TParent, TTarget>(this T control, TParent parent, Func<TTarget> targetSelector, string parentPropertyName, Action<T, string> callback, string[] propertyFilter = null) where T : SkiaControl where TParent : INotifyPropertyChanged where TTarget : class, INotifyPropertyChanged

Parameters

control T

The control subscribing to changes

parent TParent

The parent object that contains the dynamic property

targetSelector Func<TTarget>

Function that selects the target object (e.g., () => CurrentTimer)

parentPropertyName string

Name of the property on parent that affects the target selector

callback Action<T, string>

Callback that receives the control and property name when target's properties change

propertyFilter string[]

Optional filter to only trigger on specific properties

Returns

T

The control for chaining

Type Parameters

T

Type of the control being extended

TParent

Type of the parent object that contains the dynamic property

TTarget

Type of the target object to observe

ObservePropertiesOn<T, TParent, TTarget>(T, TParent, Func<TTarget>, string, IEnumerable<string>, Action<T>)

Observes specific properties on a dynamically resolved target object using a function selector. When the parent's properties change, re-evaluates the selector and automatically unsubscribes from old target and subscribes to new one. You can omit BindingContext as it will be added at all times.

public static T ObservePropertiesOn<T, TParent, TTarget>(this T control, TParent parent, Func<TTarget> targetSelector, string parentPropertyName, IEnumerable<string> propertyNames, Action<T> callback) where T : SkiaControl where TParent : INotifyPropertyChanged where TTarget : class, INotifyPropertyChanged

Parameters

control T

The control subscribing to changes

parent TParent

The parent object that contains the dynamic property

targetSelector Func<TTarget>

Function that selects the target object (e.g., () => CurrentTimer)

parentPropertyName string

Name of the property on parent that affects the target selector

propertyNames IEnumerable<string>

Names of the properties to observe on the target

callback Action<T>

Callback that receives the control when target's specified properties change

Returns

T

The control for chaining

Type Parameters

T

Type of the control being extended

TParent

Type of the parent object that contains the dynamic property

TTarget

Type of the target object to observe

ObserveProperties<T, TSource>(T, Func<TSource>, IEnumerable<string>, Action<T>)

Subscribes to specific properties changes on a source control obtained via lambda expression and executes a callback when they occur. Will unsubscribe upon control disposal.

public static T ObserveProperties<T, TSource>(this T control, Func<TSource> targetSelector, IEnumerable<string> propertyNames, Action<T> callback) where T : SkiaControl where TSource : INotifyPropertyChanged

Parameters

control T

The control subscribing to changes

targetSelector Func<TSource>

Lambda expression that returns the target control (e.g., () => clickLabel)

propertyNames IEnumerable<string>

Names of the properties to observe

callback Action<T>

Callback to execute when properties change

Returns

T

The control for chaining

Type Parameters

T

Type of the control being extended

TSource

Type of the source control being observed

ObserveProperties<T, TSource>(T, TSource, IEnumerable<string>, Action<T>)

Subscribes to specific properties changes on a source control and executes a callback when they occur.

Will unsubscribe upon control disposal.

public static T ObserveProperties<T, TSource>(this T control, TSource target, IEnumerable<string> propertyNames, Action<T> callback) where T : SkiaControl where TSource : INotifyPropertyChanged

Parameters

control T
target TSource
propertyNames IEnumerable<string>
callback Action<T>

Returns

T

Type Parameters

T
TSource

ObservePropertyOn<T, TParent, TTarget>(T, TParent, Func<TTarget>, string, string, Action<T>)

Observes a specific property on a dynamically resolved target object using a function selector. When the parent's properties change, re-evaluates the selector and automatically unsubscribes from old target and subscribes to new one.

public static T ObservePropertyOn<T, TParent, TTarget>(this T control, TParent parent, Func<TTarget> targetSelector, string parentPropertyName, string propertyName, Action<T> callback) where T : SkiaControl where TParent : INotifyPropertyChanged where TTarget : class, INotifyPropertyChanged

Parameters

control T
parent TParent
targetSelector Func<TTarget>
parentPropertyName string
propertyName string
callback Action<T>

Returns

T

Type Parameters

T
TParent
TTarget

ObserveProperty<T, TSource>(T, Func<TSource>, string, Action<T>)

Subscribes to one specific property changes on a source control obtained via lambda expression and executes a callback when they occur. Will unsubscribe upon control disposal.

public static T ObserveProperty<T, TSource>(this T control, Func<TSource> targetSelector, string propertyName, Action<T> callback) where T : SkiaControl where TSource : INotifyPropertyChanged

Parameters

control T

The control subscribing to changes

targetSelector Func<TSource>

Lambda expression that returns the target control (e.g., () => clickLabel)

propertyName string

Name of the property to observe

callback Action<T>

Callback to execute when the property changes

Returns

T

The control for chaining

Type Parameters

T

Type of the control being extended

TSource

Type of the source control being observed

ObserveProperty<T, TSource>(T, TSource, string, Action<T>)

Subscribes to one specific property changes on a source control and executes a callback when they occur. Will unsubscribe upon control disposal.

public static T ObserveProperty<T, TSource>(this T control, TSource target, string propertyName, Action<T> callback) where T : SkiaControl where TSource : INotifyPropertyChanged

Parameters

control T
target TSource
propertyName string
callback Action<T>

Returns

T

Type Parameters

T
TSource

ObserveSelf<T>(T, Action<T, string>)

Subscribes to PropertyChanged of this control, will unsubscribe upon control disposal.

public static T ObserveSelf<T>(this T view, Action<T, string> action) where T : SkiaControl

Parameters

view T
action Action<T, string>

Returns

T

The target control for chaining

Type Parameters

T

Type of the target control (the one being extended)

Observe<T, TSource>(T, Func<TSource>, Action<T, string>, string[])

Observes a control that will be assigned later in the initialization process.

public static T Observe<T, TSource>(this T control, Func<TSource> sourceFetcher, Action<T, string> callback, string[] propertyFilter = null) where T : SkiaControl where TSource : SkiaControl, INotifyPropertyChanged

Parameters

control T

The control subscribing to changes

sourceFetcher Func<TSource>

Function that will retrieve the source control when needed

callback Action<T, string>

Callback that receives the control instance and property name when changed

propertyFilter string[]

Optional filter to only trigger on specific properties

Returns

T

The target control for chaining

Type Parameters

T

Type of the target control (the one being extended)

TSource

Type of the source control (the one that will be observed)

Observe<T, TSource>(T, Func<TSource>, Action<T>, string[])

Observes a control that will be assigned later in the initialization process. Simplified version that doesn't pass the property name to the callback.

public static T Observe<T, TSource>(this T control, Func<TSource> sourceFetcher, Action<T> callback, string[] propertyFilter = null) where T : SkiaControl where TSource : SkiaControl, INotifyPropertyChanged

Parameters

control T

The control subscribing to changes

sourceFetcher Func<TSource>

Function that will retrieve the source control when needed

callback Action<T>

Callback that receives only the control instance when changed

propertyFilter string[]

Optional filter to only trigger on specific properties

Returns

T

The target control for chaining

Type Parameters

T

Type of the target control (the one being extended)

TSource

Type of the source control (the one that will be observed)

Observe<T, TSource>(T, TSource, Action<T, string>, string[])

Subscribes to property changes on a source control and executes a callback when they occur. Will unsubscribe upon control disposal.

public static T Observe<T, TSource>(this T control, TSource target, Action<T, string> callback, string[] propertyFilter = null) where T : SkiaControl where TSource : INotifyPropertyChanged

Parameters

control T

The control subscribing to changes

target TSource

The control being observed

callback Action<T, string>

Callback that receives the property name when changed

propertyFilter string[]

Optional filter to only trigger on specific properties

Returns

T

The target control for chaining

Type Parameters

T

Type of the target control (the one being extended)

TSource

Type of the source control (the one being observed)

Observe<T, TSource>(T, TSource, Action<T>, string[])

Observes a source control with a simplified callback that doesn't include the property name. Will unsubscribe upon control disposal.

public static T Observe<T, TSource>(this T control, TSource target, Action<T> callback, string[] propertyFilter = null) where T : SkiaControl where TSource : INotifyPropertyChanged

Parameters

control T

The control subscribing to changes

target TSource

The control being observed

callback Action<T>

Callback that receives only the control instance when changed

propertyFilter string[]

Optional filter to only trigger on specific properties

Returns

T

The target control for chaining

Type Parameters

T

Type of the target control (the one being extended)

TSource

Type of the source control (the one being observed)

OnLongPressing<T>(T, Action<T>)

public static T OnLongPressing<T>(this T view, Action<T> action) where T : SkiaControl

Parameters

view T
action Action<T>

Returns

T

Type Parameters

T

OnTapped<T>(T, Action<T, ControlTappedEventArgs>)

public static T OnTapped<T>(this T view, Action<T, ControlTappedEventArgs> action) where T : SkiaControl

Parameters

view T
action Action<T, ControlTappedEventArgs>

Returns

T

Type Parameters

T

OnTapped<T>(T, Action<T>)

Uses an AddGestures.SetCommandTapped with this control, will invoke code in passed callback when tapped.

public static T OnTapped<T>(this T view, Action<T> action) where T : SkiaControl

Parameters

view T
action Action<T>

Returns

T

Type Parameters

T

OnTextChanged(SkiaMauiEditor, Action<SkiaMauiEditor, string>)

Registers a callback to be executed when the text of a SkiaMauiEditor changes.

public static SkiaMauiEditor OnTextChanged(this SkiaMauiEditor control, Action<SkiaMauiEditor, string> action)

Parameters

control SkiaMauiEditor

The editor control to observe

action Action<SkiaMauiEditor, string>

Callback receiving the editor and new text

Returns

SkiaMauiEditor

The editor control for chaining

OnTextChanged(SkiaMauiEntry, Action<SkiaMauiEntry, string>)

Registers a callback to be executed when the text of a SkiaMauiEntry changes.

public static SkiaMauiEntry OnTextChanged(this SkiaMauiEntry control, Action<SkiaMauiEntry, string> action)

Parameters

control SkiaMauiEntry

The entry control to observe

action Action<SkiaMauiEntry, string>

Callback receiving the entry and new text

Returns

SkiaMauiEntry

The entry control for chaining

OnTextChanged(SkiaLabel, Action<SkiaLabel, string>)

Registers a callback to be executed when the text of a SkiaLabel changes.

public static SkiaLabel OnTextChanged(this SkiaLabel control, Action<SkiaLabel, string> action)

Parameters

control SkiaLabel

The label control to observe

action Action<SkiaLabel, string>

Callback receiving the label and new text

Returns

SkiaLabel

The label control for chaining

OnToggled<T>(T, Action<T, bool>)

State change callback for SkiaToggle and related controls

public static T OnToggled<T>(this T view, Action<T, bool> action) where T : SkiaToggle

Parameters

view T
action Action<T, bool>

Returns

T

Type Parameters

T

SetGrid<T>(T, int, int)

Sets the Grid row and column in a single call

public static T SetGrid<T>(this T view, int column, int row) where T : SkiaControl

Parameters

view T

The control to set the grid position for

column int

The column index

row int

The row index

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

SetGrid<T>(T, int, int, int, int)

Sets the Grid row, column, rowspan and columnspan in a single call

public static T SetGrid<T>(this T view, int column, int row, int columnSpan, int rowSpan) where T : SkiaControl

Parameters

view T

The control to set the grid position for

column int

The column index

row int

The row index

columnSpan int

The number of columns to span

rowSpan int

The number of rows to span

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

Shape<T>(T, ShapeType)

Sets the shape type for SkiaShape (shorter alias)

public static T Shape<T>(this T shape, ShapeType shapeType) where T : SkiaShape

Parameters

shape T

The shape to set type for

shapeType ShapeType

The shape type

Returns

T

The shape for chaining

Type Parameters

T

Type of SkiaShape

StartX<T>(T)

public static T StartX<T>(this T view) where T : SkiaControl

Parameters

view T

Returns

T

Type Parameters

T

StartY<T>(T)

public static T StartY<T>(this T view) where T : SkiaControl

Parameters

view T

Returns

T

Type Parameters

T

WhenBindingContextSet<T>(T, Action<T, object>, string[])

Registers a callback to be executed when the control's BindingContext was set/changed. Called inside base.ApplyBindingContext().

public static T WhenBindingContextSet<T>(this T control, Action<T, object> callback, string[] propertyFilter = null) where T : SkiaControl

Parameters

control T

The control to observe

callback Action<T, object>

Callback to execute when BindingContext is set

propertyFilter string[]

Optional property filter

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

WhenItemsSourceChangesApplied<T>(T, Action<T>, string[])

Triggers after a new ItemsSource was set or an observable collection of an existing one was changed for a SkiaLayout

public static T WhenItemsSourceChangesApplied<T>(this T control, Action<T> callback, string[] propertyFilter = null) where T : SkiaLayout

Parameters

control T
callback Action<T>
propertyFilter string[]

Returns

T

Type Parameters

T

WhenPaint<T>(T, Action<T, DrawingContext>)

Registers a callback to be executed during the paint phase of the control's rendering. Called inside the base.Paint(..).

public static T WhenPaint<T>(this T view, Action<T, DrawingContext> action) where T : SkiaControl

Parameters

view T

The control to attach paint logic to

action Action<T, DrawingContext>

Paint logic to run

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

WithAspect<T>(T, TransformAspect)

Sets the aspect for SkiaImage

public static T WithAspect<T>(this T image, TransformAspect aspect) where T : SkiaImage

Parameters

image T

The image to set aspect for

aspect TransformAspect

The transform aspect

Returns

T

The image for chaining

Type Parameters

T

Type of SkiaImage

WithBackgroundColor<T>(T, Color)

Sets the background color for the control

public static T WithBackgroundColor<T>(this T view, Color color) where T : SkiaControl

Parameters

view T

The control to set background color for

color Color

The background color

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

WithBottom(Thickness, double)

public static Thickness WithBottom(this Thickness existing, double value)

Parameters

existing Thickness
value double

Returns

Thickness

WithCache<T>(T, SkiaCacheType)

Sets the cache type for the control

public static T WithCache<T>(this T view, SkiaCacheType cacheType) where T : SkiaControl

Parameters

view T

The control to set cache for

cacheType SkiaCacheType

The cache type

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

WithChildren<T>(T, params SkiaControl[])

Adds multiple child controls to a layout

public static T WithChildren<T>(this T view, params SkiaControl[] children) where T : SkiaLayout

Parameters

view T

The layout to add children to

children SkiaControl[]

The children to add

Returns

T

The layout for chaining

Type Parameters

T

Type of SkiaLayout

WithColumnDefinitions(SkiaLayout, string)

Parses a string representation of column definitions and sets them on the grid

public static SkiaLayout WithColumnDefinitions(this SkiaLayout grid, string columnDefinitions)

Parameters

grid SkiaLayout

The grid to set column definitions for

columnDefinitions string

String in format like "Auto,,2,100"

Returns

SkiaLayout

The grid for chaining

Exceptions

InvalidOperationException

Thrown if conversion fails

WithColumnSpacing<T>(T, double)

Sets the ColumnSpacing property for SkiaGrid

public static T WithColumnSpacing<T>(this T grid, double spacing) where T : SkiaGrid

Parameters

grid T
spacing double

Returns

T

Type Parameters

T

WithColumnSpan<T>(T, int)

Sets the Grid.ColumnSpan attached property for the control

public static T WithColumnSpan<T>(this T view, int columnSpan) where T : SkiaControl

Parameters

view T

The control to set the column span for

columnSpan int

The number of columns to span

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

WithColumn<T>(T, int)

Sets the Grid.Column attached property for the control

public static T WithColumn<T>(this T view, int column) where T : SkiaControl

Parameters

view T

The control to set the column for

column int

The column index

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

WithContent<T>(T, SkiaControl)

Sets the content of a container that implements IWithContent

public static T WithContent<T>(this T view, SkiaControl child) where T : IWithContent

Parameters

view T

The container

child SkiaControl

The content to set

Returns

T

The container for chaining

Type Parameters

T

Type implementing IWithContent

WithEnabled<T>(T, bool)

Sets the IsEnabled property

public static T WithEnabled<T>(this T control, bool enabled) where T : SkiaControl

Parameters

control T
enabled bool

Returns

T

Type Parameters

T

WithFontSize<T>(T, double)

Sets the font size for SkiaLabel

public static T WithFontSize<T>(this T label, double fontSize) where T : SkiaLabel

Parameters

label T

The label to set font size for

fontSize double

The font size

Returns

T

The label for chaining

Type Parameters

T

Type of SkiaLabel

WithGestures<T>(T, Func<T, SkiaGesturesParameters, GestureEventProcessingInfo, ISkiaGestureListener>)

Attaches a gesture handler to a SkiaLayout, allowing custom gesture processing. You must return this control if you consumed a gesture, return null if not. The UP gesture should be marked as consumed ONLY for specific scenarios, return null for it if unsure.

public static T WithGestures<T>(this T view, Func<T, SkiaGesturesParameters, GestureEventProcessingInfo, ISkiaGestureListener> func) where T : SkiaLayout

Parameters

view T

The layout to attach gestures to

func Func<T, SkiaGesturesParameters, GestureEventProcessingInfo, ISkiaGestureListener>

A function that returns a gesture listener for the layout

Returns

T

The layout for chaining

Type Parameters

T

Type of SkiaLayout

WithHeight<T>(T, double)

Sets the height request for the control

public static T WithHeight<T>(this T view, double height) where T : SkiaControl

Parameters

view T

The control to set height for

height double

The height request

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

WithHorizontalOptions<T>(T, LayoutOptions)

Sets the horizontal options for the control

public static T WithHorizontalOptions<T>(this T view, LayoutOptions options) where T : SkiaControl

Parameters

view T

The control to set horizontal options for

options LayoutOptions

The horizontal layout options

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

WithHorizontalTextAlignment<T>(T, DrawTextAlignment)

Sets the horizontal text alignment for SkiaLabel

public static T WithHorizontalTextAlignment<T>(this T label, DrawTextAlignment alignment) where T : SkiaLabel

Parameters

label T

The label to set alignment for

alignment DrawTextAlignment

The horizontal text alignment

Returns

T

The label for chaining

Type Parameters

T

Type of SkiaLabel

WithItemsSource<T>(T, IList)

Sets the ItemsSource property for controls that have it

public static T WithItemsSource<T>(this T control, IList itemsSource) where T : SkiaLayout

Parameters

control T
itemsSource IList

Returns

T

Type Parameters

T

WithLeft(Thickness, double)

public static Thickness WithLeft(this Thickness existing, double value)

Parameters

existing Thickness
value double

Returns

Thickness

WithMargin<T>(T, Thickness)

Sets the margin for the control

public static T WithMargin<T>(this T view, Thickness margin) where T : SkiaControl

Parameters

view T

The control to set margin for

margin Thickness

The margin thickness

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

WithMargin<T>(T, double)

Sets the margin for the control

public static T WithMargin<T>(this T view, double uniformMargin) where T : SkiaControl

Parameters

view T

The control to set margin for

uniformMargin double

The uniform margin to apply to all sides

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

WithMargin<T>(T, double, double)

Sets the margin for the control

public static T WithMargin<T>(this T view, double horizontal, double vertical) where T : SkiaControl

Parameters

view T

The control to set margin for

horizontal double

The left and right margin

vertical double

The top and bottom margin

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

WithMargin<T>(T, double, double, double, double)

Sets the margin for the control

public static T WithMargin<T>(this T view, double left, double top, double right, double bottom) where T : SkiaControl

Parameters

view T

The control to set margin for

left double

The left margin

top double

The top margin

right double

The right margin

bottom double

The bottom margin

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

WithOpacity<T>(T, double)

Sets the Opacity property

public static T WithOpacity<T>(this T control, double opacity) where T : SkiaControl

Parameters

control T
opacity double

Returns

T

Type Parameters

T

WithPadding<T>(T, double)

Sets the padding for a layout control

public static T WithPadding<T>(this T view, double uniformPadding) where T : SkiaLayout

Parameters

view T

The layout to set padding for

uniformPadding double

The uniform padding to apply to all sides

Returns

T

The layout for chaining

Type Parameters

T

Type of SkiaLayout

WithPadding<T>(T, double, double)

Sets the padding for a layout control

public static T WithPadding<T>(this T view, double horizontal, double vertical) where T : SkiaLayout

Parameters

view T

The layout to set padding for

horizontal double

The left and right padding

vertical double

The top and bottom padding

Returns

T

The layout for chaining

Type Parameters

T

Type of SkiaLayout

WithPadding<T>(T, double, double, double, double)

Sets the padding for a layout control

public static T WithPadding<T>(this T view, double left, double top, double right, double bottom) where T : SkiaLayout

Parameters

view T

The layout to set padding for

left double

The left padding

top double

The top padding

right double

The right padding

bottom double

The bottom padding

Returns

T

The layout for chaining

Type Parameters

T

Type of SkiaLayout

WithParent<T>(T, IDrawnBase)

Adds the control to a parent and returns the control for further chaining

public static T WithParent<T>(this T view, IDrawnBase parent) where T : SkiaControl

Parameters

view T

The control to add

parent IDrawnBase

The parent to add the control to

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

WithPoints(SkiaShape, string)

Parses a string representation of points and sets them on the shape

public static SkiaShape WithPoints(this SkiaShape shape, string columnDefinitions)

Parameters

shape SkiaShape
columnDefinitions string

Returns

SkiaShape

Exceptions

InvalidOperationException

WithRight(Thickness, double)

public static Thickness WithRight(this Thickness existing, double value)

Parameters

existing Thickness
value double

Returns

Thickness

WithRotation<T>(T, double)

Sets the Rotation property

public static T WithRotation<T>(this T control, double rotation) where T : SkiaControl

Parameters

control T
rotation double

Returns

T

Type Parameters

T

WithRowDefinitions(SkiaLayout, string)

Parses a string representation of row definitions and sets them on the grid

public static SkiaLayout WithRowDefinitions(this SkiaLayout grid, string definitions)

Parameters

grid SkiaLayout

The grid to set row definitions for

definitions string

String in format like "Auto,,2,100"

Returns

SkiaLayout

The grid for chaining

Exceptions

InvalidOperationException

Thrown if conversion fails

WithRowSpacing<T>(T, double)

Sets the RowSpacing property for SkiaGrid

public static T WithRowSpacing<T>(this T grid, double spacing) where T : SkiaGrid

Parameters

grid T
spacing double

Returns

T

Type Parameters

T

WithRowSpan<T>(T, int)

Sets the Grid.RowSpan attached property for the control

public static T WithRowSpan<T>(this T view, int rowSpan) where T : SkiaControl

Parameters

view T

The control to set the row span for

rowSpan int

The number of rows to span

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

WithRow<T>(T, int)

Sets the Grid.Row attached property for the control

public static T WithRow<T>(this T view, int row) where T : SkiaControl

Parameters

view T

The control to set the row for

row int

The row index

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

WithScale<T>(T, double)

Sets the Scale property

public static T WithScale<T>(this T control, double scale) where T : SkiaControl

Parameters

control T
scale double

Returns

T

Type Parameters

T

WithScale<T>(T, double, double)

Sets separate X and Y scale values

public static T WithScale<T>(this T control, double scaleX, double scaleY) where T : SkiaControl

Parameters

control T
scaleX double
scaleY double

Returns

T

Type Parameters

T

WithShapeType<T>(T, ShapeType)

Sets the shape type for SkiaShape

public static T WithShapeType<T>(this T shape, ShapeType shapeType) where T : SkiaShape

Parameters

shape T

The shape to set type for

shapeType ShapeType

The shape type

Returns

T

The shape for chaining

Type Parameters

T

Type of SkiaShape

WithSpacing<T>(T, double)

Sets the Spacing property for SkiaLayout

public static T WithSpacing<T>(this T layout, double spacing) where T : SkiaLayout

Parameters

layout T
spacing double

Returns

T

Type Parameters

T

WithTag<T>(T, string)

Sets the Tag property for the control

public static T WithTag<T>(this T view, string tag) where T : SkiaControl

Parameters

view T

The control to set the Tag for

tag string

The tag value

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

WithTextColor<T>(T, Color)

Sets the text color for SkiaLabel

public static T WithTextColor<T>(this T label, Color color) where T : SkiaLabel

Parameters

label T

The label to set text color for

color Color

The text color

Returns

T

The label for chaining

Type Parameters

T

Type of SkiaLabel

WithText<T>(T, string)

Sets the Text property for SkiaLabel

public static T WithText<T>(this T label, string text) where T : SkiaLabel

Parameters

label T
text string

Returns

T

Type Parameters

T

WithTop(Thickness, double)

public static Thickness WithTop(this Thickness existing, double value)

Parameters

existing Thickness
value double

Returns

Thickness

WithType<T>(T, LayoutType)

Sets the Type property for SkiaLayout

public static T WithType<T>(this T layout, LayoutType type) where T : SkiaLayout

Parameters

layout T
type LayoutType

Returns

T

Type Parameters

T

WithVerticalOptions<T>(T, LayoutOptions)

Sets the vertical options for the control

public static T WithVerticalOptions<T>(this T view, LayoutOptions options) where T : SkiaControl

Parameters

view T

The control to set vertical options for

options LayoutOptions

The vertical layout options

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl

WithVisibility<T>(T, bool)

public static T WithVisibility<T>(this T view, bool value) where T : SkiaControl

Parameters

view T
value bool

Returns

T

Type Parameters

T

WithWidth<T>(T, double)

Sets the width request for the control

public static T WithWidth<T>(this T view, double width) where T : SkiaControl

Parameters

view T

The control to set width for

width double

The width request

Returns

T

The control for chaining

Type Parameters

T

Type of SkiaControl