AvaloniaObjectExtensionsAddClassHandlerTTarget, TValue(IObservableAvaloniaPropertyChangedEventArgsTValue, ActionTTarget, AvaloniaPropertyChangedEventArgsTValue) 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, TValue>(
	this IObservable<AvaloniaPropertyChangedEventArgs<TValue>> observable,
	Action<TTarget, AvaloniaPropertyChangedEventArgs<TValue>> action
)
where TTarget : AvaloniaObject

Parameters

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

Type Parameters

TTarget
The type of the property change sender.
TValue
The type of the property.

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 IObservableAvaloniaPropertyChangedEventArgsTValue. 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