Skip to main content

Add Method

Adds a handler to the route.

Definition

Namespace: Avalonia.Interactivity
Assembly: Avalonia.Base (in Avalonia.Base.dll)

public void Add(
Interactive target,
Delegate handler,
RoutingStrategies routes,
bool handledEventsToo = false,
Action<Delegate, Object, RoutedEventArgs>? adapter = null
)

Parameters

  Interactive
The target on which the event should be raised.
  Delegate
The handler for the event.
  RoutingStrategies
The routing strategies to listen to.
  Boolean  (Optional)
If true the handler will be raised even when the routed event is marked as handled.
  Action(Delegate, 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

Reference

EventRoute Class
Avalonia.Interactivity Namespace