Skip to main content

Class ButtonExtensions

Namespace: Aspid.FastTools.UIElements
Assembly: Aspid.FastTools.dll

Provides extension methods for Button.

public static class ButtonExtensions

Inheritance​

object ← ButtonExtensions

Methods​

AddClicked<T>(T, Action)​

Subscribes to the clicked event.

public static T AddClicked<T>(this T element, Action action) where T : Button

Parameters​

element T

The element to modify.

action Action

The action to invoke when the button is clicked.

Returns​

T

The element, for chaining.

Type Parameters​

T

The element type.

RemoveClicked<T>(T, Action)​

Unsubscribes from the clicked event.

public static T RemoveClicked<T>(this T element, Action action) where T : Button

Parameters​

element T

The element to modify.

action Action

The action to remove.

Returns​

T

The element, for chaining.

Type Parameters​

T

The element type.

SetClickable<T>(T, Clickable)​

Sets clickable.

public static T SetClickable<T>(this T element, Clickable value) where T : Button

Parameters​

element T

The element to modify.

value Clickable

The clickable manipulator to set.

Returns​

T

The element, for chaining.

Type Parameters​

T

The element type.

SetClickable<T>(T, Action)​

Replaces clickable with a new Clickable that invokes action.

public static T SetClickable<T>(this T element, Action action) where T : Button

Parameters​

element T

The element to modify.

action Action

The action to invoke on click.

Returns​

T

The element, for chaining.

Type Parameters​

T

The element type.

SetIconImage<T>(T, Background)​

Sets iconImage.

public static T SetIconImage<T>(this T element, Background value) where T : Button

Parameters​

element T

The element to modify.

value Background

The icon image to set.

Returns​

T

The element, for chaining.

Type Parameters​

T

The element type.