Skip to main content

GetObservable<TEventArgs> Method

Gets an observable for a RoutedEvent(TEventArgs).

Definition​

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

public static IObservable<TEventArgs> GetObservable<TEventArgs>(
this Interactive o,
RoutedEvent<TEventArgs> routedEvent,
RoutingStrategies routes = RoutingStrategies.Direct|RoutingStrategies.Bubble,
bool handledEventsToo = false
)
where TEventArgs : RoutedEventArgs

Parameters​

  Interactive
The object to listen for events on.
  RoutedEvent(TEventArgs)
The routed event.
  RoutingStrategies  (Optional)
The routing strategies to listen to.
  Boolean  (Optional)
Whether handled events should also be listened for.

Type Parameters​

Return Value​

IObservable(TEventArgs)
An observable which fires each time the event is raised.

Usage Note​

In Visual Basic and C#, you can call this method as an instance method on any object of type Interactive. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also​

Reference​

InteractiveExtensions Class
Avalonia.Interactivity Namespace