Class ManipulatorExtensions
Namespace: Aspid.FastTools.UIElements
Assembly: Aspid.FastTools.dll
Provides extension methods that attach manipulators to a VisualElement.
public static class ManipulatorExtensions
Inheritance
object ← ManipulatorExtensions
Methods
AddClickable<T>(T, Action)
Adds a new Clickable manipulator that invokes the specified handler.
public static T AddClickable<T>(this T element, Action handler) where T : VisualElement
Parameters
element T
The element to modify.
handler Action
The action to invoke when the element is clicked.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
AddClickable<T>(T, Action, out Clickable)
Adds a new Clickable manipulator that invokes the specified handler and outputs the created manipulator.
public static T AddClickable<T>(this T element, Action handler, out Clickable manipulator) where T : VisualElement
Parameters
element T
The element to modify.
handler Action
The action to invoke when the element is clicked.
manipulator Clickable
The created Clickable manipulator.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
AddClickable<T>(T, Action<EventBase>)
Adds a new Clickable manipulator that invokes the specified handler with the triggering EventBase.
public static T AddClickable<T>(this T element, Action<EventBase> handler) where T : VisualElement
Parameters
element T
The element to modify.
handler Action<EventBase>
The action to invoke when the element is clicked, receiving the triggering event.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
AddClickable<T>(T, Action<EventBase>, out Clickable)
Adds a new Clickable manipulator that invokes the specified handler with the triggering EventBase and outputs the created manipulator.
public static T AddClickable<T>(this T element, Action<EventBase> handler, out Clickable manipulator) where T : VisualElement
Parameters
element T
The element to modify.
handler Action<EventBase>
The action to invoke when the element is clicked, receiving the triggering event.
manipulator Clickable
The created Clickable manipulator.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
AddClickable<T>(T, Action, long, long)
Adds a new repeating Clickable manipulator that invokes the specified handler after an initial delay and then at a fixed interval while pressed.
public static T AddClickable<T>(this T element, Action handler, long delay, long interval) where T : VisualElement
Parameters
element T
The element to modify.
handler Action
The action to invoke on each click tick.
delay long
The delay, in milliseconds, before the first repeated invocation.
interval long
The interval, in milliseconds, between subsequent invocations while pressed.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
AddClickable<T>(T, Action, long, long, out Clickable)
Adds a new repeating Clickable manipulator that invokes the specified handler after an initial delay and then at a fixed interval while pressed, and outputs the created manipulator.
public static T AddClickable<T>(this T element, Action handler, long delay, long interval, out Clickable manipulator) where T : VisualElement
Parameters
element T
The element to modify.
handler Action
The action to invoke on each click tick.
delay long
The delay, in milliseconds, before the first repeated invocation.
interval long
The interval, in milliseconds, between subsequent invocations while pressed.
manipulator Clickable
The created Clickable manipulator.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
AddContextualMenuManipulator<T>(T, Action<ContextualMenuPopulateEvent>)
Adds a new ContextualMenuManipulator that uses the specified menu builder to populate the contextual menu.
public static T AddContextualMenuManipulator<T>(this T element, Action<ContextualMenuPopulateEvent> menuBuilder) where T : VisualElement
Parameters
element T
The element to modify.
menuBuilder Action<ContextualMenuPopulateEvent>
The action invoked to populate the menu when it is shown.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
AddContextualMenuManipulator<T>(T, Action<ContextualMenuPopulateEvent>, out ContextualMenuManipulator)
Adds a new ContextualMenuManipulator that uses the specified menu builder to populate the contextual menu, and outputs the created manipulator.
public static T AddContextualMenuManipulator<T>(this T element, Action<ContextualMenuPopulateEvent> menuBuilder, out ContextualMenuManipulator manipulator) where T : VisualElement
Parameters
element T
The element to modify.
menuBuilder Action<ContextualMenuPopulateEvent>
The action invoked to populate the menu when it is shown.
manipulator ContextualMenuManipulator
The created ContextualMenuManipulator.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
AddKeyboardNavigationManipulator<T>(T, Action<KeyboardNavigationOperation, EventBase>)
Adds a new KeyboardNavigationManipulator that invokes the specified action for keyboard navigation operations.
public static T AddKeyboardNavigationManipulator<T>(this T element, Action<KeyboardNavigationOperation, EventBase> action) where T : VisualElement
Parameters
element T
The element to modify.
action Action<KeyboardNavigationOperation, EventBase>
The action to invoke with the KeyboardNavigationOperation and triggering EventBase.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
AddKeyboardNavigationManipulator<T>(T, Action<KeyboardNavigationOperation, EventBase>, out KeyboardNavigationManipulator)
Adds a new KeyboardNavigationManipulator that invokes the specified action for keyboard navigation operations, and outputs the created manipulator.
public static T AddKeyboardNavigationManipulator<T>(this T element, Action<KeyboardNavigationOperation, EventBase> action, out KeyboardNavigationManipulator manipulator) where T : VisualElement
Parameters
element T
The element to modify.
action Action<KeyboardNavigationOperation, EventBase>
The action to invoke with the KeyboardNavigationOperation and triggering EventBase.
manipulator KeyboardNavigationManipulator
The created KeyboardNavigationManipulator.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
AddManipulatorSelf<T>(T, IManipulator)
Adds an IManipulator to the element.
public static T AddManipulatorSelf<T>(this T element, IManipulator manipulator) where T : VisualElement
Parameters
element T
The element to modify.
manipulator IManipulator
The manipulator to add.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
RemoveManipulatorSelf<T>(T, IManipulator)
Removes an IManipulator from the element.
public static T RemoveManipulatorSelf<T>(this T element, IManipulator manipulator) where T : VisualElement
Parameters
element T
The element to modify.
manipulator IManipulator
The manipulator to remove.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.