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
RoutedEventThe routed event to be raised.
Properties
HasHandlers
Gets a value indicating whether the route has any handlers.
public bool HasHandlers { get; }
Property Value
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
InteractiveThe target on which the event should be raised.
handler
DelegateThe handler for the event.
routes
RoutingStrategiesThe routing strategies to listen to.
handledEventsToo
boolIf 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 callingDynamicInvoke
on the handler.
AddClassHandler(Interactive)
Adds a class handler to the route.
public void AddClassHandler(Interactive target)
Parameters
target
InteractiveThe 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
InteractiveThe event source.
e
RoutedEventArgsThe event args.