Add Method
Adds a handler to the route.
Definition
Namespace: Avalonia.Interactivity
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public void Add(
Interactive target,
Delegate handler,
RoutingStrategies routes,
bool handledEventsToo = false,
Action<Delegate, Object, RoutedEventArgs>? adapter = null
)
Public Sub Add (
target As Interactive,
handler As Delegate,
routes As RoutingStrategies,
Optional handledEventsToo As Boolean = false,
Optional adapter As Action(Of Delegate, Object, RoutedEventArgs) = Nothing
)
member Add :
target : Interactive *
handler : Delegate *
routes : RoutingStrategies *
?handledEventsToo : bool *
?adapter : Action<Delegate, Object, RoutedEventArgs>
(* Defaults:
let _handledEventsToo = defaultArg handledEventsToo false
let _adapter = defaultArg adapter null
*)
-> unit
Parameters
- Interactive
- The target on which the event should be raised.
- Delegate
- The handler for the event.
- RoutingStrategies
- The routing strategies to listen to.
- Boolean (Optional)
- If true the handler will be raised even when the routed event is marked as handled.
- Action(Delegate, Object, RoutedEventArgs) (Optional)
- 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.