Class FluentExtensions
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
viewTThe control to act upon
actionAction<T>The action to perform
Returns
- T
The control for chaining
Type Parameters
TType of SkiaControl
AssignNative<T>(T, out T)
public static T AssignNative<T>(this T control, out T variable) where T : VisualElement
Parameters
controlTvariableT
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
controlTThe control to assign
parentSkiaControlThe parent control to add to
Returns
- T
The control for chaining
Type Parameters
TType 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
controlTThe control to assign
variableTThe out variable to store the reference
Returns
- T
The control for chaining
Type Parameters
TType 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
viewTThe UI element that will have its property bound to a source property.
targetPropertyBindablePropertyThe property of the view that will receive the binding.
sourceINotifyPropertyChangedThe object that implements property change notifications and serves as the data source.
pathstringThe path to the property on the source object that will be bound to the target property.
modeBindingModeSpecifies the binding mode, determining how the source and target properties interact.
Returns
- T
Returns the view after setting up the binding.
Type Parameters
TRepresents 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
viewTThe control to set the binding for
propertyBindablePropertypathstringThe binding path
modeBindingModeThe binding mode
Returns
- T
The control for chaining
Type Parameters
TType 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
viewTThe control to set the binding for
targetPropertyBindablePropertyThe target property
pathstringThe binding path
converterIValueConverterThe value converter
converterParameterobjectThe converter parameter
modeBindingModeThe binding mode
Returns
- T
The control for chaining
Type Parameters
TType of SkiaControl
TPropertyType 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
viewTThe control to center horizontally
Returns
- T
The control for chaining
Type Parameters
TType 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
viewTThe control to center vertically
Returns
- T
The control for chaining
Type Parameters
TType of SkiaControl
Center<T>(T)
Centers the control both horizontally and vertically
public static T Center<T>(this T view) where T : SkiaControl
Parameters
viewTThe control to center
Returns
- T
The control for chaining
Type Parameters
TType of SkiaControl
EndX<T>(T)
public static T EndX<T>(this T view) where T : SkiaControl
Parameters
viewT
Returns
- T
Type Parameters
T
EndY<T>(T)
public static T EndY<T>(this T view) where T : SkiaControl
Parameters
viewT
Returns
- T
Type Parameters
T
FillX<T>(T)
Fills horizontally
public static T FillX<T>(this T view) where T : SkiaControl
Parameters
viewT
Returns
- T
Type Parameters
T
FillY<T>(T)
Fills vertically
public static T FillY<T>(this T view) where T : SkiaControl
Parameters
viewT
Returns
- T
Type Parameters
T
Fill<T>(T)
Fills in both directions
public static T Fill<T>(this T view) where T : SkiaControl
Parameters
viewT
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
viewTThe control to initialize
actionAction<T>Initialization logic to run
Returns
- T
The control for chaining
Type Parameters
TType 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
controlTThe control to extend
targetTTargetThe target control whose BindingContext to watch
callbackAction<T, TTarget, TSource, string>Callback executed when properties change, receiving the control, the target control, the typed BindingContext, and the property name
debugTypeMismatchboolWhether to log a warning when the actual BindingContext type doesn't match TSource (default: true)
Returns
- T
The original control for chaining
Type Parameters
TType of the control being extended
TTargetType of the target control whose BindingContext we're watching
TSourceExpected type of the target control's BindingContext
Remarks
This method handles two scenarios:
- The target's BindingContext is already set when the method is called
- 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
controlTThe control to watch
callbackAction<T, TSource, string>Callback executed when properties change, receiving the control, the typed BindingContext, and the property name
debugTypeMismatchboolWhether to log a warning when the actual BindingContext type doesn't match TSource (default: true)
Returns
- T
The control for chaining
Type Parameters
TType of the control
TSourceExpected type of the BindingContext
Remarks
This method handles two scenarios:
- The BindingContext is already set when the method is called
- 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
controlTThe control subscribing to changes
parentTParentThe parent object that contains the dynamic property
targetSelectorFunc<TTarget>Function that selects the target object (e.g., () => CurrentTimer)
parentPropertyNamestringName of the property on parent that affects the target selector
callbackAction<T, string>Callback that receives the control and property name when target's properties change
propertyFilterstring[]Optional filter to only trigger on specific properties
Returns
- T
The control for chaining
Type Parameters
TType of the control being extended
TParentType of the parent object that contains the dynamic property
TTargetType 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
controlTThe control subscribing to changes
parentTParentThe parent object that contains the dynamic property
targetSelectorFunc<TTarget>Function that selects the target object (e.g., () => CurrentTimer)
parentPropertyNamestringName of the property on parent that affects the target selector
propertyNamesIEnumerable<string>Names of the properties to observe on the target
callbackAction<T>Callback that receives the control when target's specified properties change
Returns
- T
The control for chaining
Type Parameters
TType of the control being extended
TParentType of the parent object that contains the dynamic property
TTargetType 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
controlTThe control subscribing to changes
targetSelectorFunc<TSource>Lambda expression that returns the target control (e.g., () => clickLabel)
propertyNamesIEnumerable<string>Names of the properties to observe
callbackAction<T>Callback to execute when properties change
Returns
- T
The control for chaining
Type Parameters
TType of the control being extended
TSourceType 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
controlTtargetTSourcepropertyNamesIEnumerable<string>callbackAction<T>
Returns
- T
Type Parameters
TTSource
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
controlTparentTParenttargetSelectorFunc<TTarget>parentPropertyNamestringpropertyNamestringcallbackAction<T>
Returns
- T
Type Parameters
TTParentTTarget
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
controlTThe control subscribing to changes
targetSelectorFunc<TSource>Lambda expression that returns the target control (e.g., () => clickLabel)
propertyNamestringName of the property to observe
callbackAction<T>Callback to execute when the property changes
Returns
- T
The control for chaining
Type Parameters
TType of the control being extended
TSourceType 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
Returns
- T
Type Parameters
TTSource
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
Returns
- T
The target control for chaining
Type Parameters
TType 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
controlTThe control subscribing to changes
sourceFetcherFunc<TSource>Function that will retrieve the source control when needed
callbackAction<T, string>Callback that receives the control instance and property name when changed
propertyFilterstring[]Optional filter to only trigger on specific properties
Returns
- T
The target control for chaining
Type Parameters
TType of the target control (the one being extended)
TSourceType 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
controlTThe control subscribing to changes
sourceFetcherFunc<TSource>Function that will retrieve the source control when needed
callbackAction<T>Callback that receives only the control instance when changed
propertyFilterstring[]Optional filter to only trigger on specific properties
Returns
- T
The target control for chaining
Type Parameters
TType of the target control (the one being extended)
TSourceType 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
controlTThe control subscribing to changes
targetTSourceThe control being observed
callbackAction<T, string>Callback that receives the property name when changed
propertyFilterstring[]Optional filter to only trigger on specific properties
Returns
- T
The target control for chaining
Type Parameters
TType of the target control (the one being extended)
TSourceType 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
controlTThe control subscribing to changes
targetTSourceThe control being observed
callbackAction<T>Callback that receives only the control instance when changed
propertyFilterstring[]Optional filter to only trigger on specific properties
Returns
- T
The target control for chaining
Type Parameters
TType of the target control (the one being extended)
TSourceType 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
viewTactionAction<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
viewTactionAction<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
viewTactionAction<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
controlSkiaMauiEditorThe editor control to observe
actionAction<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
controlSkiaMauiEntryThe entry control to observe
actionAction<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
controlSkiaLabelThe label control to observe
actionAction<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
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
Returns
- T
The control for chaining
Type Parameters
TType 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
viewTThe control to set the grid position for
columnintThe column index
rowintThe row index
columnSpanintThe number of columns to span
rowSpanintThe number of rows to span
Returns
- T
The control for chaining
Type Parameters
TType 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
shapeTThe shape to set type for
shapeTypeShapeTypeThe shape type
Returns
- T
The shape for chaining
Type Parameters
TType of SkiaShape
StartX<T>(T)
public static T StartX<T>(this T view) where T : SkiaControl
Parameters
viewT
Returns
- T
Type Parameters
T
StartY<T>(T)
public static T StartY<T>(this T view) where T : SkiaControl
Parameters
viewT
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
controlTThe control to observe
callbackAction<T, object>Callback to execute when BindingContext is set
propertyFilterstring[]Optional property filter
Returns
- T
The control for chaining
Type Parameters
TType 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
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
viewTThe control to attach paint logic to
actionAction<T, DrawingContext>Paint logic to run
Returns
- T
The control for chaining
Type Parameters
TType 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
imageTThe image to set aspect for
aspectTransformAspectThe transform aspect
Returns
- T
The image for chaining
Type Parameters
TType 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
viewTThe control to set background color for
colorColorThe background color
Returns
- T
The control for chaining
Type Parameters
TType of SkiaControl
WithBottom(Thickness, double)
public static Thickness WithBottom(this Thickness existing, double value)
Parameters
Returns
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
viewTThe control to set cache for
cacheTypeSkiaCacheTypeThe cache type
Returns
- T
The control for chaining
Type Parameters
TType 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
viewTThe layout to add children to
childrenSkiaControl[]The children to add
Returns
- T
The layout for chaining
Type Parameters
TType 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
gridSkiaLayoutThe grid to set column definitions for
columnDefinitionsstringString 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
gridTspacingdouble
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
viewTThe control to set the column span for
columnSpanintThe number of columns to span
Returns
- T
The control for chaining
Type Parameters
TType 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
viewTThe control to set the column for
columnintThe column index
Returns
- T
The control for chaining
Type Parameters
TType 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
viewTThe container
childSkiaControlThe content to set
Returns
- T
The container for chaining
Type Parameters
TType implementing IWithContent
WithEnabled<T>(T, bool)
Sets the IsEnabled property
public static T WithEnabled<T>(this T control, bool enabled) where T : SkiaControl
Parameters
controlTenabledbool
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
labelTThe label to set font size for
fontSizedoubleThe font size
Returns
- T
The label for chaining
Type Parameters
TType 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
viewTThe layout to attach gestures to
funcFunc<T, SkiaGesturesParameters, GestureEventProcessingInfo, ISkiaGestureListener>A function that returns a gesture listener for the layout
Returns
- T
The layout for chaining
Type Parameters
TType 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
viewTThe control to set height for
heightdoubleThe height request
Returns
- T
The control for chaining
Type Parameters
TType 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
viewTThe control to set horizontal options for
optionsLayoutOptionsThe horizontal layout options
Returns
- T
The control for chaining
Type Parameters
TType 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
labelTThe label to set alignment for
alignmentDrawTextAlignmentThe horizontal text alignment
Returns
- T
The label for chaining
Type Parameters
TType 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
controlTitemsSourceIList
Returns
- T
Type Parameters
T
WithLeft(Thickness, double)
public static Thickness WithLeft(this Thickness existing, double value)
Parameters
Returns
WithMargin<T>(T, Thickness)
Sets the margin for the control
public static T WithMargin<T>(this T view, Thickness margin) where T : SkiaControl
Parameters
viewTThe control to set margin for
marginThicknessThe margin thickness
Returns
- T
The control for chaining
Type Parameters
TType 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
viewTThe control to set margin for
uniformMargindoubleThe uniform margin to apply to all sides
Returns
- T
The control for chaining
Type Parameters
TType 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
viewTThe control to set margin for
horizontaldoubleThe left and right margin
verticaldoubleThe top and bottom margin
Returns
- T
The control for chaining
Type Parameters
TType 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
viewTThe control to set margin for
leftdoubleThe left margin
topdoubleThe top margin
rightdoubleThe right margin
bottomdoubleThe bottom margin
Returns
- T
The control for chaining
Type Parameters
TType of SkiaControl
WithOpacity<T>(T, double)
Sets the Opacity property
public static T WithOpacity<T>(this T control, double opacity) where T : SkiaControl
Parameters
controlTopacitydouble
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
viewTThe layout to set padding for
uniformPaddingdoubleThe uniform padding to apply to all sides
Returns
- T
The layout for chaining
Type Parameters
TType 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
viewTThe layout to set padding for
horizontaldoubleThe left and right padding
verticaldoubleThe top and bottom padding
Returns
- T
The layout for chaining
Type Parameters
TType 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
viewTThe layout to set padding for
leftdoubleThe left padding
topdoubleThe top padding
rightdoubleThe right padding
bottomdoubleThe bottom padding
Returns
- T
The layout for chaining
Type Parameters
TType 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
viewTThe control to add
parentIDrawnBaseThe parent to add the control to
Returns
- T
The control for chaining
Type Parameters
TType 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
Returns
Exceptions
WithRight(Thickness, double)
public static Thickness WithRight(this Thickness existing, double value)
Parameters
Returns
WithRotation<T>(T, double)
Sets the Rotation property
public static T WithRotation<T>(this T control, double rotation) where T : SkiaControl
Parameters
controlTrotationdouble
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
gridSkiaLayoutThe grid to set row definitions for
definitionsstringString 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
gridTspacingdouble
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
viewTThe control to set the row span for
rowSpanintThe number of rows to span
Returns
- T
The control for chaining
Type Parameters
TType 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
viewTThe control to set the row for
rowintThe row index
Returns
- T
The control for chaining
Type Parameters
TType of SkiaControl
WithScale<T>(T, double)
Sets the Scale property
public static T WithScale<T>(this T control, double scale) where T : SkiaControl
Parameters
controlTscaledouble
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
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
shapeTThe shape to set type for
shapeTypeShapeTypeThe shape type
Returns
- T
The shape for chaining
Type Parameters
TType 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
layoutTspacingdouble
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
viewTThe control to set the Tag for
tagstringThe tag value
Returns
- T
The control for chaining
Type Parameters
TType 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
labelTThe label to set text color for
colorColorThe text color
Returns
- T
The label for chaining
Type Parameters
TType 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
labelTtextstring
Returns
- T
Type Parameters
T
WithTop(Thickness, double)
public static Thickness WithTop(this Thickness existing, double value)
Parameters
Returns
WithType<T>(T, LayoutType)
Sets the Type property for SkiaLayout
public static T WithType<T>(this T layout, LayoutType type) where T : SkiaLayout
Parameters
layoutTtypeLayoutType
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
viewTThe control to set vertical options for
optionsLayoutOptionsThe vertical layout options
Returns
- T
The control for chaining
Type Parameters
TType of SkiaControl
WithVisibility<T>(T, bool)
public static T WithVisibility<T>(this T view, bool value) where T : SkiaControl
Parameters
viewTvaluebool
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
viewTThe control to set width for
widthdoubleThe width request
Returns
- T
The control for chaining
Type Parameters
TType of SkiaControl