EventRouteAdd Method

Adds a handler to the route.

Definition

Namespace: Avalonia.Interactivity
Assembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
public void Add(
	Interactive target,
	Delegate handler,
	RoutingStrategies routes,
	bool handledEventsToo = false,
	Action<Delegate, Object, RoutedEventArgs>? adapter = null
)

Parameters

target  Interactive
The target on which the event should be raised.
handler  Delegate
The handler for the event.
routes  RoutingStrategies
The routing strategies to listen to.
handledEventsToo  Boolean  (Optional)
If true the handler will be raised even when the routed event is marked as handled.
adapter  ActionDelegate, Object, RoutedEventArgs  (Optional)
An optional adapter which if supplied, will be called with handler and the parameters for the event. This adapter can be used to avoid calling `DynamicInvoke` on the handler.

See Also