共用方式為


IEditableCollectionView Interface

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

Defines methods and properties that a collection view implements to provide editing capabilities to a collection.

Namespace:  System.ComponentModel
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
<TypeForwardedFromAttribute("System.Windows.Data, Version=2.0.5.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")> _
Public Interface IEditableCollectionView
[TypeForwardedFromAttribute("System.Windows.Data, Version=2.0.5.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
public interface IEditableCollectionView

The IEditableCollectionView type exposes the following members.

Properties

  Name Description
Public propertySupported by Silverlight for Windows Phone CanAddNew Gets a value that indicates whether a new item can be added to the collection.
Public propertySupported by Silverlight for Windows Phone CanCancelEdit Gets a value that indicates whether the collection view can discard pending changes and restore the original values of an edited object.
Public propertySupported by Silverlight for Windows Phone CanRemove Gets a value that indicates whether an item can be removed from the collection.
Public propertySupported by Silverlight for Windows Phone CurrentAddItem Gets the item that is being added during the current add transaction.
Public propertySupported by Silverlight for Windows Phone CurrentEditItem Gets the item in the collection that is being edited.
Public propertySupported by Silverlight for Windows Phone IsAddingNew Gets a value that indicates whether an add transaction is in progress.
Public propertySupported by Silverlight for Windows Phone IsEditingItem Gets a value that indicates whether an edit transaction is in progress.
Public propertySupported by Silverlight for Windows Phone NewItemPlaceholderPosition Gets or sets the position of the new item placeholder in the collection view.

Top

Methods

  Name Description
Public methodSupported by Silverlight for Windows Phone AddNew Adds a new item to the underlying collection.
Public methodSupported by Silverlight for Windows Phone CancelEdit Ends the edit transaction and, if possible, restores the original value of the item.
Public methodSupported by Silverlight for Windows Phone CancelNew Ends the add transaction and discards the pending new item.
Public methodSupported by Silverlight for Windows Phone CommitEdit Ends the edit transaction and saves the pending changes.
Public methodSupported by Silverlight for Windows Phone CommitNew Ends the add transaction and saves the pending new item.
Public methodSupported by Silverlight for Windows Phone EditItem Begins an edit transaction on the specified item.
Public methodSupported by Silverlight for Windows Phone Remove Removes the specified item from the collection.
Public methodSupported by Silverlight for Windows Phone RemoveAt Removes the item at the specified position from the collection.

Top

Remarks

When a collection view implements the IEditableCollectionView interface, you can directly change the underlying collection, if it allows changes to be made, by using the methods and properties that IEditableCollectionView exposes, regardless of the collection's type.

The PagedCollectionView type implements IEditableCollectionView, so you can edit a collection that uses that type.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

Platforms

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