AvaloniaObjectExtensionsAddClassHandlerTTarget(IObservableAvaloniaPropertyChangedEventArgs, ActionTTarget, AvaloniaPropertyChangedEventArgs) Method

Subscribes to a property changed notifications for changes that originate from a TTarget.

Definition

Namespace: Avalonia
Assembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
public static IDisposable AddClassHandler<TTarget>(
	this IObservable<AvaloniaPropertyChangedEventArgs> observable,
	Action<TTarget, AvaloniaPropertyChangedEventArgs> action
)
where TTarget : AvaloniaObject

Parameters

observable  IObservableAvaloniaPropertyChangedEventArgs
The property changed observable.
action  ActionTTarget, AvaloniaPropertyChangedEventArgs
The method to call. The parameters are the sender and the event args.

Type Parameters

TTarget
The type of the property change sender.

Return Value

IDisposable
A disposable that can be used to terminate the subscription.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IObservableAvaloniaPropertyChangedEventArgs. 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