WeakSubscribe(INotifyCollectionChanged, NotifyCollectionChangedEventHandler) Method
Subscribes to the CollectionChanged event using a weak subscription.
Definition
Namespace: Avalonia.Collections
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public static IDisposable WeakSubscribe(
this INotifyCollectionChanged collection,
NotifyCollectionChangedEventHandler handler
)
<ExtensionAttribute>
Public Shared Function WeakSubscribe (
collection As INotifyCollectionChanged,
handler As NotifyCollectionChangedEventHandler
) As IDisposable
[<ExtensionAttribute>]
static member WeakSubscribe :
collection : INotifyCollectionChanged *
handler : NotifyCollectionChangedEventHandler -> IDisposable
Parameters
- INotifyCollectionChanged
- The collection.
- NotifyCollectionChangedEventHandler
- An action called when the collection event is raised.
Return Value
IDisposable
A disposable 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 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).
See Also
Reference
NotifyCollectionChangedExtensions Class
WeakSubscribe Overload
Avalonia.Collections Namespace