FREE TRIAL

|

☀
☾

UIBlockExtensions.AddGestureHandler

AddGestureHandler<TGesture, TVisuals>(UIBlock, UIEventHandler<TGesture, TVisuals>)

Subscribe to a gesture event on this UIBlock's descendant hierarchy (inclusive of this UIBlock), filtered to the given ItemVisuals type, TVisuals.

Remarks

The subscription only "lives" on this UIBlock, but the event will propagate up from descendents triggering gesture events with an gestureHandler type-matched signature.

Declaration
public static void AddGestureHandler<TGesture, TVisuals>(this UIBlock uiBlock, UIEventHandler<TGesture, TVisuals> gestureHandler)
    where TGesture : struct, IGestureEvent where TVisuals : ItemVisuals
Parameters
Type Name Description
UIBlock uiBlock
UIEventHandler<TGesture, TVisuals> gestureHandler

The callback invoked when the event fires.

Type Parameters
Name Description
TGesture

The type of gesture event to handle.

TVisuals

The ItemVisuals type to target as the event propagates. If no object of this type is in the event propogation path, the gestureHandler won't be invoked.

Exceptions
Type Condition
System.ArgumentNullException

If uiBlock or gestureHandler is null.

See Also
Gesture.OnClick
Gesture.OnPress
Gesture.OnRelease
Gesture.OnHover
Gesture.OnUnhover
Gesture.OnScroll
Gesture.OnMove
Gesture.OnDrag
Gesture.OnCancel
FireGestureEvent<TGesture>(TGesture)
☀
☾
In This Article
Legal EmailContact Github
Copyright © 2022 Supernova Technologies, LLC