WeakSubscribe(INotifyCollectionChanged, Action<NotifyCollectionChangedEventArgs>) 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,
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
Parameters
- INotifyCollectionChanged
- The collection.
- Action(NotifyCollectionChangedEventArgs)
- 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