Export (0) Print
Expand All

CollectionChangedEventManager Class

Provides a WeakEventManager implementation so that you can use the "weak event listener" pattern to attach listeners for the CollectionChanged event.

System.Object
  System.Windows.Threading.DispatcherObject
    System.Windows.WeakEventManager
      System.Collections.Specialized.CollectionChangedEventManager

Namespace:  System.Collections.Specialized
Assembly:  WindowsBase (in WindowsBase.dll)

public class CollectionChangedEventManager : WeakEventManager

The CollectionChangedEventManager type exposes the following members.

  NameDescription
Public propertyDispatcherGets the Dispatcher this DispatcherObject is associated with. (Inherited from DispatcherObject.)
Protected propertyItemGets or sets the data being stored for the specified source. (Inherited from WeakEventManager.)
Protected propertyReadLockEstablishes a read-lock on the underlying data table, and returns an IDisposable. (Inherited from WeakEventManager.)
Protected propertyWriteLockEstablishes a write-lock on the underlying data table, and returns anIDisposable. (Inherited from WeakEventManager.)
Top

  NameDescription
Public methodStatic memberAddHandlerAdds the specified event handler, which is called when specified source raises the CollectionChanged event.
Public methodStatic memberAddListenerAdds the specified listener to the CollectionChanged event of the specified source.
Public methodCheckAccessDetermines whether the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Protected methodDeliverEventDelivers the event being managed to each listener. (Inherited from WeakEventManager.)
Protected methodDeliverEventToListDelivers the event being managed to each listener in the provided list. (Inherited from WeakEventManager.)
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodNewListenerListReturns a new object to contain listeners to the CollectionChanged event. (Overrides WeakEventManager.NewListenerList().)
Protected methodProtectedAddHandlerAdds the specified delegate as an event handler of the specified source. (Inherited from WeakEventManager.)
Protected methodProtectedAddListenerAdds the provided listener to the provided source for the event being managed. (Inherited from WeakEventManager.)
Protected methodProtectedRemoveHandlerRemoves the previously added handler from the specified source. (Inherited from WeakEventManager.)
Protected methodProtectedRemoveListenerRemoves a previously added listener from the provided source. (Inherited from WeakEventManager.)
Protected methodPurgeRemoves inactive listener entries from the data list for the provided source. Returns true if some entries were actually removed from the list. (Inherited from WeakEventManager.)
Protected methodRemoveRemoves all listeners for the specified source. (Inherited from WeakEventManager.)
Public methodStatic memberRemoveHandlerRemoves the specified event handler from the specified source.
Public methodStatic memberRemoveListenerRemoves the specified listener from the CollectionChanged event of the specified source.
Protected methodScheduleCleanupRequests that a purge of unused entries in the underlying listener list be performed on a lower priority thread. (Inherited from WeakEventManager.)
Protected methodStartListeningBegins listening for the CollectionChanged event on the specified source. (Overrides WeakEventManager.StartListening(Object).)
Protected methodStopListeningStops listening for the CollectionChanged event on the specified source. (Overrides WeakEventManager.StopListening(Object).)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodVerifyAccessEnforces that the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Top

In order to be listeners in this pattern, your listener objects must implement IWeakEventListener. You do not need to implement IWeakEventListener on the class that is the source of the events.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft