Skip to main content

BuildEventRoute Method

Builds an event route for a routed event.

Definition​

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

protected EventRoute BuildEventRoute(
RoutedEvent e
)

Parameters​

  RoutedEvent
The routed event.

Return Value​

EventRoute
An EventRoute describing the route.

Remarks​

Usually, calling RaiseEvent(RoutedEventArgs) is sufficient to raise a routed event, however there are situations in which the construction of the event args is expensive and should be avoided if there are no handlers for an event. In these cases you can call this method to build the event route and check the HasHandlers property to see if there are any handlers registered on the route. If there are, call RaiseEvent(Interactive, RoutedEventArgs) to raise the event.

See Also​

Reference​

Interactive Class
Avalonia.Interactivity Namespace