InteractiveExtensions.

AddDisposableHandler<TEventArgs>(IInteractive, RoutedEvent<TEventArgs>, EventHandler<TEventArgs>, RoutingStrategies, bool) Method

Summary

Adds a handler for the specified routed event and returns a disposable that can terminate the event subscription.
Namespace
Avalonia.Interactivity
Containing Type
InteractiveExtensions

Syntax

public static IDisposable AddDisposableHandler<TEventArgs>(this IInteractive o, RoutedEvent<TEventArgs> routedEvent, EventHandler<TEventArgs> handler, RoutingStrategies routes = Direct | Bubble, bool handledEventsToo = false) 
    where TEventArgs : RoutedEventArgs

Type Parameters

Name Description
TEventArgs The type of the event's args.

Parameters

Name Type Description
o IInteractive Target for adding given event handler.
routedEvent RoutedEvent<TEventArgs> The routed event.
handler EventHandler<TEventArgs> The handler.
routes RoutingStrategies The routing strategies to listen to.
handledEventsToo bool Whether handled events should also be listened for.

Return Value

Type Description
IDisposable A disposable that terminates the event subscription.