Table of Contents

Class EventRoute

Namespace
Avalonia.Interactivity
Assembly
Avalonia.Base.dll

Holds the route for a routed event and supports raising an event on that route.

public class EventRoute : IDisposable
Inheritance
EventRoute
Implements
Inherited Members

Constructors

EventRoute(RoutedEvent)

Initializes a new instance of the RoutedEvent class.

public EventRoute(RoutedEvent e)

Parameters

e RoutedEvent

The routed event to be raised.

Properties

HasHandlers

Gets a value indicating whether the route has any handlers.

public bool HasHandlers { get; }

Property Value

bool

Methods

Add(Interactive, Delegate, RoutingStrategies, bool, Action<Delegate, object, RoutedEventArgs>?)

Adds a handler to the route.

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 bool

If true the handler will be raised even when the routed event is marked as handled.

adapter Action<Delegate, object, RoutedEventArgs>

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.

AddClassHandler(Interactive)

Adds a class handler to the route.

public void AddClassHandler(Interactive target)

Parameters

target Interactive

The target on which the event should be raised.

Dispose()

Disposes of the event route.

public void Dispose()

RaiseEvent(Interactive, RoutedEventArgs)

Raises an event along the route.

public void RaiseEvent(Interactive source, RoutedEventArgs e)

Parameters

source Interactive

The event source.

e RoutedEventArgs

The event args.