Defines methods and properties that a CollectionView implements to provide editing capabilities to a collection.
Assembly: WindowsBase (in WindowsBase.dll)
Gets a value that indicates whether a new item can be added to the collection.
Gets a value that indicates whether the collection view can discard pending changes and restore the original values of an edited object.
Gets a value that indicates whether an item can be removed from the collection.
Gets the item that is being added during the current add transaction.
Gets the item in the collection that is being edited.
Gets a value that indicates whether an add transaction is in progress.
Gets a value that indicates whether an edit transaction is in progress.
Gets or sets the position of the new item placeholder in the collection view.
Adds a new item to the collection.
Ends the edit transaction and, if possible, restores the original value to the item.
Ends the add transaction and discards the pending new item.
Ends the edit transaction and saves the pending changes.
Ends the add transaction and saves the pending new item.
Begins an edit transaction of the specified item.
Removes the specified item from the collection.
Removes the item at the specified position from the collection.
When a collection view implements theinterface, you can directly change the underlying collection, if it allows changes to be made, by using the methods and properties that exposes, regardless of the collection's type.
The types ItemCollection, BindingListCollectionView, and ListCollectionView are the types that ship with Windows Presentation Foundation (WPF) that inherit from CollectionView. These types also implement the , so you can edit a collection that uses one of those types. ItemCollection, in particular, is often used because the ItemsControl.Items property is an ItemCollection.
The following example shows how to add an item to a collection by using methods that are defined by Changing a Collection by Using IEditableCollectionView Sample.. This application displays a list of items for sale and gives the user the option of adding, editing, or removing an item. When the user adds or edits an item, a form prompts the user to enter a new item. If the user submits the form, the item is committed to the collection. If the user cancels the form, the item is discarded. For the entire sample, see
Available since 3.0
Available since 3.0
Windows Phone Silverlight
Available since 7.1