Skip to main content

AddHandler<TEventArgs>(RoutedEvent<TEventArgs>, EventHandler<TEventArgs>, RoutingStrategies, Boolean) Method

Adds a handler for the specified routed event.

Definition​

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

public void AddHandler<TEventArgs>(
RoutedEvent<TEventArgs> routedEvent,
EventHandler<TEventArgs>? handler,
RoutingStrategies routes = RoutingStrategies.Direct|RoutingStrategies.Bubble,
bool handledEventsToo = false
)
where TEventArgs : RoutedEventArgs

Parameters​

  RoutedEvent(TEventArgs)
The routed event.
  EventHandler(TEventArgs)
The handler.
  RoutingStrategies  (Optional)
The routing strategies to listen to.
  Boolean  (Optional)
Whether handled events should also be listened for.

Type Parameters​

The type of the event's args.

See Also​

Reference​

Interactive Class
AddHandler Overload
Avalonia.Interactivity Namespace