Xamarin.Forms Guides | Samples

Xamarin.Forms.CollectionSynchronizationCallback Delegate


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


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


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.


Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions:,,,,,,

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

See Also: Delegate