Interactive.

BuildEventRoute(RoutedEvent) Method

Summary

Builds an event route for a routed event.
Namespace
Avalonia.Interactivity
Containing Type
Interactive

Syntax

protected EventRoute BuildEventRoute(RoutedEvent e)

Remarks

Usually, calling RaiseEvent(RoutedEventArgs) is sufficent 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(IInteractive, RoutedEventArgs) to raise the event.

Parameters

Name Type Description
e RoutedEvent The routed event.

Return Value

Type Description
EventRoute An EventRoute describing the route.