Xamarin.Forms Guides | Samples

Xamarin.Forms.CollectionSynchronizationCallback Delegate

Syntax

public delegate Void CollectionSynchronizationCallback (IEnumerable collection,Object context,Action accessMethod,Boolean writeAccess)

Parameters

collection
The collection that was passed to BindingBase.EnableCollectionSynchronization.
context
The context or lock object that was passed to BindingBase.EnableCollectionSynchronization.
accessMethod
An action that reads or modifies collection.
writeAccess
A value that tells whether write access is required by accessMethod.

Remarks

Application developers implement a Forms.CollectionSynchronizationCallback method and pass it to the BindingBase.EnableCollectionSynchronization method to enable correct multithreaded access to collection. After synchronization is enabled, the Xamarin.Forms framework passes accessMethod to the application developer's implementation of Forms.CollectionSynchronizationCallback each time that the framework needs to modify the collection in a multithreaded environment. The application developer's implementation should decide, based on the context object (which may be merely a locking object or the object on which the collection lives) and the value of the writeAccess parameter, whether or not to lock while calling accessMethod.

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0, 1.4.0.0, 1.5.0.0, 2.0.0.0

The members of Xamarin.Forms.CollectionSynchronizationCallback are listed below.

See Also: Delegate