CollectionSynchronizationCallback CollectionSynchronizationCallback Delegate

Definition

Delegate for callback in Xamarin.Forms.BindingBase.EnableCollectionSynchronization.

public delegate void CollectionSynchronizationCallback(IEnumerable collection, object context, Action accessMethod, bool writeAccess);
type CollectionSynchronizationCallback = delegate of IEnumerable * obj * Action * bool -> unit
Parameters
collection

The collection that was passed to Xamarin.Forms.BindingBase.EnableCollectionSynchronization.

context

The context or lock object that was passed to Xamarin.Forms.BindingBase.EnableCollectionSynchronization.

accessMethod

An action that reads or modifies collection.

writeAccess

A value that tells whether write access is required by accessMethod.

Inheritance
CollectionSynchronizationCallbackCollectionSynchronizationCallback

Remarks

Application developers implement a CollectionSynchronizationCallback method and pass it to the Xamarin.Forms.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 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.

Applies to