Aracılığıyla paylaş


NotifyCollectionChangedAction Enumeration

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Describes the action that caused a CollectionChanged event.

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

Syntax

'Declaration
Public Enumeration NotifyCollectionChangedAction
public enum NotifyCollectionChangedAction

Members

Member name Description
Supported by Silverlight for Windows Phone Add One or more items were added to the collection.
Supported by Silverlight for Windows Phone Remove One or more items were removed from the collection.
Supported by Silverlight for Windows Phone Replace One or more items were replaced in the collection.
Supported by Silverlight for Windows Phone Reset The content of the collection changed dramatically.

Remarks

The .NET Framework implementation of NotifyCollectionChangedAction defined an additional member value Move. Silverlight does not support this value. Moving a collection item should be reported through the actions that initiated the move, which are typically calls to Remove and Add in sequence. (Most collection classes or interfaces do not define an explicit "Move" API.)

Reporting Reset is discretionary. You should report Reset in cases where the number of individual Add / Remove / Replace actions necessary to properly report changes in a collection becomes excessive. For example, you should report Reset if a list was completely re-ordered based on some operation such as sorting.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.