InteractiveAddHandlerTEventArgs(RoutedEventTEventArgs, EventHandlerTEventArgs, RoutingStrategies, Boolean) Method

Adds a handler for the specified routed event.

Definition

Namespace: Avalonia.Interactivity
Assembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
public void AddHandler<TEventArgs>(
	RoutedEvent<TEventArgs> routedEvent,
	EventHandler<TEventArgs>? handler,
	RoutingStrategies routes = RoutingStrategies.Direct|RoutingStrategies.Bubble,
	bool handledEventsToo = false
)
where TEventArgs : RoutedEventArgs

Parameters

routedEvent  RoutedEventTEventArgs
The routed event.
handler  EventHandlerTEventArgs
The handler.
routes  RoutingStrategies  (Optional)
The routing strategies to listen to.
handledEventsToo  Boolean  (Optional)
Whether handled events should also be listened for.

Type Parameters

TEventArgs
The type of the event's args.

See Also