NotifyCollectionChangedExtensionsWeakSubscribe(INotifyCollectionChanged, ActionNotifyCollectionChangedEventArgs) Method
Subscribes to the CollectionChanged event using a weak subscription.
Namespace: Avalonia.CollectionsAssembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
public static IDisposable WeakSubscribe(
this INotifyCollectionChanged collection,
Action<NotifyCollectionChangedEventArgs> handler
)
<ExtensionAttribute>
Public Shared Function WeakSubscribe (
collection As INotifyCollectionChanged,
handler As Action(Of NotifyCollectionChangedEventArgs)
) As IDisposable
[<ExtensionAttribute>]
static member WeakSubscribe :
collection : INotifyCollectionChanged *
handler : Action<NotifyCollectionChangedEventArgs> -> IDisposable
- collection INotifyCollectionChanged
- The collection.
- handler ActionNotifyCollectionChangedEventArgs
-
An action called when the collection event is raised.
IDisposableA disposable used to terminate the subscription.In Visual Basic and C#, you can call this method as an instance method on any object of type
INotifyCollectionChanged. 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).