AvaloniaDictionaryExtensionsForEachItemTKey, TValue Method
Invokes an action for each item in a collection and subsequently each item added or
removed from the collection.
Namespace: Avalonia.CollectionsAssembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
public static IDisposable ForEachItem<TKey, TValue>(
this IAvaloniaReadOnlyDictionary<TKey, TValue> collection,
Action<TKey, TValue> added,
Action<TKey, TValue> removed,
Action reset,
bool weakSubscription = false
)
<ExtensionAttribute>
Public Shared Function ForEachItem(Of TKey, TValue) (
collection As IAvaloniaReadOnlyDictionary(Of TKey, TValue),
added As Action(Of TKey, TValue),
removed As Action(Of TKey, TValue),
reset As Action,
Optional weakSubscription As Boolean = false
) As IDisposable
[<ExtensionAttribute>]
static member ForEachItem :
collection : IAvaloniaReadOnlyDictionary<'TKey, 'TValue> *
added : Action<'TKey, 'TValue> *
removed : Action<'TKey, 'TValue> *
reset : Action *
?weakSubscription : bool
(* Defaults:
let _weakSubscription = defaultArg weakSubscription false
*)
-> IDisposable
- collection IAvaloniaReadOnlyDictionaryTKey, TValue
- The collection.
- added ActionTKey, TValue
-
An action called initially for each item in the collection and subsequently for each
item added to the collection. The parameters passed are the index in the collection and
the item.
- removed ActionTKey, TValue
-
An action called for each item removed from the collection. The parameters passed are
the index in the collection and the item.
- reset Action
-
An action called when the collection is reset. This will be followed by calls to
added for each item present in the collection after the reset.
- weakSubscription Boolean (Optional)
-
Indicates if a weak subscription should be used to track changes to the collection.
- TKey
- The key type of the collection items.
- TValue
- The value type of the collection items.
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
IAvaloniaReadOnlyDictionaryTKey,
TValue. 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).