ItemCollection ItemCollection ItemCollection ItemCollection Class

定义

保留构成 ItemsControl 内容的项的列表。Holds the list of items that constitute the content of an ItemsControl.

public ref class ItemCollection sealed : System::Windows::Data::CollectionView, System::Collections::IList, System::ComponentModel::ICollectionViewLiveShaping, System::ComponentModel::IEditableCollectionViewAddNewItem, System::ComponentModel::IItemProperties, System::Windows::IWeakEventListener
[System.Windows.Localizability(System.Windows.LocalizationCategory.Ignore)]
public sealed class ItemCollection : System.Windows.Data.CollectionView, System.Collections.IList, System.ComponentModel.ICollectionViewLiveShaping, System.ComponentModel.IEditableCollectionViewAddNewItem, System.ComponentModel.IItemProperties, System.Windows.IWeakEventListener
type ItemCollection = class
    inherit CollectionView
    interface IList
    interface ICollection
    interface IEnumerable
    interface IEditableCollectionViewAddNewItem
    interface IEditableCollectionView
    interface ICollectionViewLiveShaping
    interface IItemProperties
    interface IWeakEventListener
Public NotInheritable Class ItemCollection
Inherits CollectionView
Implements ICollectionViewLiveShaping, IEditableCollectionViewAddNewItem, IItemProperties, IList, IWeakEventListener
继承
属性
实现

示例

如果你拥有ItemsControl, 如ListBox包含内容的, 则可以使用Items属性来访问ItemCollection, 它是一个视图。If you have an ItemsControl, such as a ListBox that has content, you can use the Items property to access the ItemCollection, which is a view. 由于它是一个视图, 因此您可以使用与视图相关的功能, 如排序、筛选和分组。Because it is a view, you can then use the view-related functionalities such as sorting, filtering, and grouping. 请注意, 设置 System.windows.controls.itemscontrol.itemssource 后, 视图操作将委托给 System.windows.controls.itemscontrol.itemssource 集合上的视图。Note that when ItemsSource is set, the view operations delegate to the view over the ItemsSource collection. 因此, 只有在委托视图支持时, ItemCollection 才支持排序、筛选和分组。Therefore, the ItemCollection supports sorting, filtering, and grouping only if the delegated view supported them.

下面的示例演示如何对ListBox命名myListBox的的内容进行排序。The following example shows how to sort the content of a ListBox named myListBox. 在此示例中Content , 是要按其排序的属性的名称。In this example, Content is the name of the property to sort by.

myListBox.Items.SortDescriptions.Add(
    new SortDescription("Content", ListSortDirection.Descending));
myListBox.Items.SortDescriptions.Add(New SortDescription("Content", ListSortDirection.Descending))

当你执行此操作时, 视图可能为默认视图, 也可能不是, 具体取决于在上ItemsControl设置数据的方式。When you do this, the view might or might not be the default view, depending on how the data is set up on your ItemsControl. 例如, 将ItemsSource属性绑定CollectionViewSource到时, 使用Items属性获取的视图不是默认视图。For example, when the ItemsSource property is bound to a CollectionViewSource, the view that you obtain using the Items property is not the default view.

如果已绑定 (使用属性), 则可以执行以下操作来获取默认视图: ItemsSource ItemsControlIf your ItemsControl is bound (you are using the ItemsSource property), then you can do the following to get the default view:

CollectionView myView;
Private myView As CollectionView
myView = (CollectionView)CollectionViewSource.GetDefaultView(myItemsControl.ItemsSource);
myView = CType(CollectionViewSource.GetDefaultView(myItemsControl.ItemsSource), CollectionView)

或者, 您可以XAMLXAML使用CollectionViewSource指定筛选、排序和分组条件。Alternately, you can specify filtering, sorting, and grouping criteria in XAMLXAML using CollectionViewSource.

注解

ItemCollection维护项的集合, 如字符串、对象、 XMLXML节点、元素和其他集合。ItemCollection maintains a collection of items such as strings, objects, XMLXML nodes, elements, and other collections. 使用中的数据来生成其内容。 ItemCollection ItemsControlAn ItemsControl uses the data in the ItemCollection to generate its content. 如果要聚合多个集合, 请将分配CompositeCollection ItemsSource给的属性ItemsControlIf you want to aggregate more than one collection, assign a CompositeCollection to the ItemsSource property of your ItemsControl.

使用属性或属性来指定应用于ItemsControl生成的内容的集合。 ItemsSource ItemsUse either the Items property or the ItemsSource property to specify the collection that should be used to generate the content of your ItemsControl. 如果设置ItemsSource了属性, 则Items集合将变为只读且固定大小。When the ItemsSource property is set, the Items collection will be made read-only and fixed-size. 这意味着, 如果使用ItemsSource属性, 则不能ItemCollection直接在中添加、删除或更改项。This means that if you are using the ItemsSource property, you cannot add, delete, or change items in the ItemCollection directly.

ItemCollectionCollectionView为, 因此提供了集合视图功能, 如排序、分组和筛选。ItemCollection is a CollectionView and therefore provides collection view functionalities, such as sorting, grouping, and filtering. 有关详细信息,请参阅SortDescriptionsFilterGroupDescriptionsFor more information, see SortDescriptions, Filter, and GroupDescriptions.

有关集合视图的详细信息, 请参阅数据绑定概述For more information about collection views, see Data Binding Overview.

属性

AllowsCrossThreadChanges AllowsCrossThreadChanges AllowsCrossThreadChanges AllowsCrossThreadChanges

获取指示创建的 CollectionView 线程能更改 SourceCollection 的值。Gets a value that indicates whether a thread other than the one that created the CollectionView can change the SourceCollection.

(Inherited from CollectionView)
CanChangeLiveFiltering CanChangeLiveFiltering CanChangeLiveFiltering CanChangeLiveFiltering

获取一个值,该值指示集合视图是否支持打开或关闭实时筛选数据。Gets a value that indicates whether the collection view supports turning filtering data in real time on or off.

CanChangeLiveGrouping CanChangeLiveGrouping CanChangeLiveGrouping CanChangeLiveGrouping

获取一个值,该值指示集合视图是否支持在真实时间中打开或关闭分组数据。Gets a value that indicates whether the collection view supports turning grouping data in real time on or off.

CanChangeLiveSorting CanChangeLiveSorting CanChangeLiveSorting CanChangeLiveSorting

获取一个值,该值指示集合视图是否支持在真实时间中打开或关闭排序数据。Gets a value that indicates whether the collection view supports turning sorting data in real time on or off.

CanFilter CanFilter CanFilter CanFilter

获取一个值,该值指示此集合视图是否支持筛选。Gets a value that indicates whether this collection view supports filtering.

CanGroup CanGroup CanGroup CanGroup

获取一个值,该值指示此集合视图是否支持分组。Gets a value that indicates whether this collection view supports grouping.

CanSort CanSort CanSort CanSort

获取一个值,该值指示此集合视图是否支持排序。Gets a value that indicates whether this collection view supports sorting.

Comparer Comparer Comparer Comparer

返回可用于比较视图中的项的对象。Returns an object that you can use to compare items in the view.

(Inherited from CollectionView)
Count Count Count Count

获取集合中的记录数。Gets the number of records in the collection.

Culture Culture Culture Culture

获取或设置排序期间使用的区域性信息。Gets or sets the culture information to use during sorting.

(Inherited from CollectionView)
CurrentItem CurrentItem CurrentItem CurrentItem

获取视图中的当前项。Gets the current item in the view.

CurrentPosition CurrentPosition CurrentPosition CurrentPosition

获取视图中当前项的序号位置。Gets the ordinal position of the current item within the view.

Dispatcher Dispatcher Dispatcher Dispatcher

获取与此 Dispatcher 关联的 DispatcherObjectGets the Dispatcher this DispatcherObject is associated with.

(Inherited from DispatcherObject)
Filter Filter Filter Filter

获取或设置用于确定某个项是否适合包含在视图中的回调。Gets or sets a callback used to determine if an item is suitable for inclusion in the view.

GroupDescriptions GroupDescriptions GroupDescriptions GroupDescriptions

获取定义如何对项分组的 GroupDescription 对象的集合。Gets a collection of GroupDescription objects that defines how to group the items.

Groups Groups Groups Groups

获取根据 GroupDescriptions 构造的顶级组。Gets the top-level groups that are constructed according to the GroupDescriptions.

IsCurrentAfterLast IsCurrentAfterLast IsCurrentAfterLast IsCurrentAfterLast

获取一个值,该值指示视图的当前项是否超出集合的结尾。Gets a value that indicates whether the current item of the view is beyond the end of the collection.

IsCurrentBeforeFirst IsCurrentBeforeFirst IsCurrentBeforeFirst IsCurrentBeforeFirst

获取一个值,该值指示视图的当前项是否超出集合的开头。Gets a value that indicates whether the current item of the view is beyond the beginning of the collection.

IsCurrentInSync IsCurrentInSync IsCurrentInSync IsCurrentInSync

获取一个值,该值指示 CurrentItem 是否位于 CurrentPositionGets a value that indicates whether the CurrentItem is at the CurrentPosition.

(Inherited from CollectionView)
IsDynamic IsDynamic IsDynamic IsDynamic

获取一个值,该值指示基础集合是否提供更改通知。Gets a value that indicates whether the underlying collection provides change notifications.

(Inherited from CollectionView)
IsEmpty IsEmpty IsEmpty IsEmpty

获取一个值,该值指示最终的(已筛选)视图是否为空。Gets a value that indicates whether the resulting (filtered) view is empty.

IsInUse IsInUse IsInUse IsInUse

获取指示所有对象是否支持此 CollectionView 事件的值。Gets a value that indicates whether any object is subscribing to the events of this CollectionView.

(Inherited from CollectionView)
IsLiveFiltering IsLiveFiltering IsLiveFiltering IsLiveFiltering

获取或设置一个值,该值指示是否启用实时筛选数据。Gets or sets a value that indicates whether filtering data in real time is enabled.

IsLiveGrouping IsLiveGrouping IsLiveGrouping IsLiveGrouping

获取或设置一个值,该值指示是否启用实时数据分组。Gets or sets a value that indicates whether grouping data in real time is enabled.

IsLiveSorting IsLiveSorting IsLiveSorting IsLiveSorting

获取或设置一个值,该值指示是否启用实时排序。Gets or sets a value that indicates whether sorting in real time is enabled.

IsRefreshDeferred IsRefreshDeferred IsRefreshDeferred IsRefreshDeferred

获取一个值,该值指示是否有某个未完成的 DeferRefresh() 正在运行。Gets a value that indicates whether there is an outstanding DeferRefresh() in use.

(Inherited from CollectionView)
Item[Int32] Item[Int32] Item[Int32] Item[Int32]

获取或设置位于给定的从零开始的索引处的项。Gets or sets the item at the given zero-based index.

LiveFilteringProperties LiveFilteringProperties LiveFilteringProperties LiveFilteringProperties

获取在真实时间中参与筛选数据的属性的字符集合。Gets a collection of strings that specify the properties that participate in filtering data in real time.

LiveGroupingProperties LiveGroupingProperties LiveGroupingProperties LiveGroupingProperties

获取在真实时间中参与分组数据的属性的字符集合。Gets a collection of strings that specify the properties that participate in grouping data in real time.

LiveSortingProperties LiveSortingProperties LiveSortingProperties LiveSortingProperties

获取在真实时间中参与排序数据的属性的字符集合。Gets a collection of strings that specify the properties that participate in sorting data in real time.

NeedsRefresh NeedsRefresh NeedsRefresh NeedsRefresh

获取一个值,该值指示集合是否需要刷新。Gets a value that indicates whether the collection needs to be refreshed.

SortDescriptions SortDescriptions SortDescriptions SortDescriptions

获取 SortDescription 对象的集合,这些对象描述集合中的项在视图中的排序方式。Gets a collection of SortDescription objects that describe how the items in the collection are sorted in the view.

SourceCollection SourceCollection SourceCollection SourceCollection

获取位于此集合视图下的未排序和未筛选的集合。Gets the unsorted and unfiltered collection that underlies this collection view.

UpdatedOutsideDispatcher UpdatedOutsideDispatcher UpdatedOutsideDispatcher UpdatedOutsideDispatcher

获取一个值,该值指示是否必须更新更改日志,因为在没有先进入用户界面 (UI)user interface (UI) 线程调度程序的情况下,已在其他线程上收到 CollectionChanged 通知。Gets a value that indicates whether it has been necessary to update the change log because a CollectionChanged notification has been received on a different thread without first entering the 用户界面 (UI)user interface (UI) thread dispatcher.

(Inherited from CollectionView)

方法

Add(Object) Add(Object) Add(Object) Add(Object)

将某项添加到 ItemCollection 中。Adds an item to the ItemCollection.

CheckAccess() CheckAccess() CheckAccess() CheckAccess()

确定调用线程是否可以访问此 DispatcherObjectDetermines whether the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)
Clear() Clear() Clear() Clear()

清除集合并释放集合中当前所有项的引用。Clears the collection and releases the references on all items currently in the collection.

ClearChangeLog() ClearChangeLog() ClearChangeLog() ClearChangeLog()

从更改日志中清除所有挂起的更改。Clears any pending changes from the change log.

(Inherited from CollectionView)
ClearPendingChanges() ClearPendingChanges() ClearPendingChanges() ClearPendingChanges()

清除未处理更改为集合。Clears unprocessed changed to the collection.

(Inherited from CollectionView)
Contains(Object) Contains(Object) Contains(Object) Contains(Object)

返回一个值,该值指示指定的项是否在此视图中。Returns a value that indicates whether the specified item is in this view.

CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

从特定的数组索引开始,将集合的元素复制到数组中。Copies the elements of the collection to an array, starting at a particular array index.

DeferRefresh() DeferRefresh() DeferRefresh() DeferRefresh()

进入延迟循环,该循环可用于将更改合并到视图并延迟自动刷新。Enters a defer cycle that you can use to merge changes to the view and delay automatic refresh.

DetachFromSourceCollection() DetachFromSourceCollection() DetachFromSourceCollection() DetachFromSourceCollection()

CollectionView 中移除对基础集合的引用。Removes the reference to the underlying collection from the CollectionView.

(Inherited from CollectionView)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

返回可用于枚举视图中的项的对象。Returns an object that you can use to enumerate the items in the view.

(Inherited from CollectionView)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetItemAt(Int32) GetItemAt(Int32) GetItemAt(Int32) GetItemAt(Int32)

返回此视图中位于从零开始的指定索引处的项。Returns the item at the specified zero-based index in this view.

GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
IndexOf(Object) IndexOf(Object) IndexOf(Object) IndexOf(Object)

返回指定项在集合中的索引。Returns the index in this collection where the specified item is located.

Insert(Int32, Object) Insert(Int32, Object) Insert(Int32, Object) Insert(Int32, Object)

在集合中的指定索引处插入一个元素。Inserts an element into the collection at the specified index.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
MoveCurrentTo(Object) MoveCurrentTo(Object) MoveCurrentTo(Object) MoveCurrentTo(Object)

将集合中的指定项设置为 CurrentItemSets the specified item in the collection as the CurrentItem.

MoveCurrentToFirst() MoveCurrentToFirst() MoveCurrentToFirst() MoveCurrentToFirst()

将视图中的第一项设置为 CurrentItemSets the first item in the view as the CurrentItem.

MoveCurrentToLast() MoveCurrentToLast() MoveCurrentToLast() MoveCurrentToLast()

将视图中的最后一项设置为 CurrentItemSets the last item in the view as the CurrentItem.

MoveCurrentToNext() MoveCurrentToNext() MoveCurrentToNext() MoveCurrentToNext()

将视图中位于 CurrentItem 之后的项设置为 CurrentItemSets the item after the CurrentItem in the view as the CurrentItem.

MoveCurrentToPosition(Int32) MoveCurrentToPosition(Int32) MoveCurrentToPosition(Int32) MoveCurrentToPosition(Int32)

将位于指定索引位置的项设置为视图中的 CurrentItemSets the item at the specified index to be the CurrentItem in the view.

MoveCurrentToPrevious() MoveCurrentToPrevious() MoveCurrentToPrevious() MoveCurrentToPrevious()

将视图中位于 CurrentItem 之前的项设置为 CurrentItemSets the item before the CurrentItem in the view as the CurrentItem.

OKToChangeCurrent() OKToChangeCurrent() OKToChangeCurrent() OKToChangeCurrent()

返回一个值,该值指示视图是否可以更改作为 CurrentItem 的项。Returns a value that indicates whether the view can change which item is the CurrentItem.

(Inherited from CollectionView)
OnAllowsCrossThreadChangesChanged() OnAllowsCrossThreadChangesChanged() OnAllowsCrossThreadChangesChanged() OnAllowsCrossThreadChangesChanged()

AllowsCrossThreadChanges 属性更改时发生。Occurs when the AllowsCrossThreadChanges property changes.

(Inherited from CollectionView)
OnBeginChangeLogging(NotifyCollectionChangedEventArgs) OnBeginChangeLogging(NotifyCollectionChangedEventArgs) OnBeginChangeLogging(NotifyCollectionChangedEventArgs) OnBeginChangeLogging(NotifyCollectionChangedEventArgs)

由基类调用,以通知派生类 CollectionChanged 事件已发送到消息队列。Called by the base class to notify the derived class that an CollectionChanged event has been posted to the message queue.

(Inherited from CollectionView)
OnCollectionChanged(NotifyCollectionChangedEventArgs) OnCollectionChanged(NotifyCollectionChangedEventArgs) OnCollectionChanged(NotifyCollectionChangedEventArgs) OnCollectionChanged(NotifyCollectionChangedEventArgs)

引发 CollectionChanged 事件。Raises the CollectionChanged event.

(Inherited from CollectionView)
OnCollectionChanged(Object, NotifyCollectionChangedEventArgs) OnCollectionChanged(Object, NotifyCollectionChangedEventArgs) OnCollectionChanged(Object, NotifyCollectionChangedEventArgs) OnCollectionChanged(Object, NotifyCollectionChangedEventArgs)

引发 CollectionChanged 事件。Raises the CollectionChanged event.

(Inherited from CollectionView)
OnCurrentChanged() OnCurrentChanged() OnCurrentChanged() OnCurrentChanged()

引发 CurrentChanged 事件。Raises the CurrentChanged event.

(Inherited from CollectionView)
OnCurrentChanging() OnCurrentChanging() OnCurrentChanging() OnCurrentChanging()

引发一个不可取消的 CurrentChanging 事件。Raises a CurrentChanging event that is not cancelable.

(Inherited from CollectionView)
OnCurrentChanging(CurrentChangingEventArgs) OnCurrentChanging(CurrentChangingEventArgs) OnCurrentChanging(CurrentChangingEventArgs) OnCurrentChanging(CurrentChangingEventArgs)

用指定的参数引发 CurrentChanging 事件。Raises the CurrentChanging event with the specified arguments.

(Inherited from CollectionView)
OnPropertyChanged(PropertyChangedEventArgs) OnPropertyChanged(PropertyChangedEventArgs) OnPropertyChanged(PropertyChangedEventArgs) OnPropertyChanged(PropertyChangedEventArgs)

用指定的参数引发 PropertyChanged 事件。Raises the PropertyChanged event using the specified arguments.

(Inherited from CollectionView)
PassesFilter(Object) PassesFilter(Object) PassesFilter(Object) PassesFilter(Object)

返回一个值,该值指示指定项是否属于此视图。Returns a value that indicates whether the specified item belongs to this view.

ProcessCollectionChanged(NotifyCollectionChangedEventArgs) ProcessCollectionChanged(NotifyCollectionChangedEventArgs) ProcessCollectionChanged(NotifyCollectionChangedEventArgs) ProcessCollectionChanged(NotifyCollectionChangedEventArgs)

在派生类中重写时,处理 UIUI 线程上的单个更改。When overridden in a derived class, processes a single change on the UIUI thread.

(Inherited from CollectionView)
ProcessPendingChanges() ProcessPendingChanges() ProcessPendingChanges() ProcessPendingChanges()

确保此集合的所有待定更改都已被提交。Ensures that all pending changes to the collection have been committed.

(Inherited from CollectionView)
Refresh() Refresh() Refresh() Refresh()

重新创建视图。Re-creates the view.

(Inherited from CollectionView)
RefreshOrDefer() RefreshOrDefer() RefreshOrDefer() RefreshOrDefer()

刷新视图或指定视图在延迟循环完成后需要刷新。Refreshes the view or specifies that the view needs to be refreshed when the defer cycle completes.

(Inherited from CollectionView)
RefreshOverride() RefreshOverride() RefreshOverride() RefreshOverride()

重新创建视图。Re-creates the view.

(Inherited from CollectionView)
Remove(Object) Remove(Object) Remove(Object) Remove(Object)

从集合或视图中移除指定的项引用。Removes the specified item reference from the collection or view.

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

移除位于集合或视图中的指定索引处的项。Removes the item at the specified index of the collection or view.

SetCurrent(Object, Int32) SetCurrent(Object, Int32) SetCurrent(Object, Int32) SetCurrent(Object, Int32)

将指定项和索引设置为 CurrentItemCurrentPosition 属性的值。Sets the specified item and index as the values of the CurrentItem and CurrentPosition properties.

(Inherited from CollectionView)
SetCurrent(Object, Int32, Int32) SetCurrent(Object, Int32, Int32) SetCurrent(Object, Int32, Int32) SetCurrent(Object, Int32, Int32)

将指定项和索引设置为 CurrentItemCurrentPosition 属性的值。Sets the specified item and index as the values of the CurrentItem and CurrentPosition properties. 可以从派生类的构造函数中调用此方法。This method can be called from a constructor of a derived class.

(Inherited from CollectionView)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)
VerifyAccess() VerifyAccess() VerifyAccess() VerifyAccess()

强制调用线程具有此 DispatcherObject 的访问权限。Enforces that the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)

显式界面实现

ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

此成员支持 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基础结构,但不能在代码中直接使用。This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

此成员支持 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基础结构,但不能在代码中直接使用。This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

IEditableCollectionView.AddNew() IEditableCollectionView.AddNew() IEditableCollectionView.AddNew() IEditableCollectionView.AddNew()

将新项添加到集合中。Adds a new item to the collection.

IEditableCollectionView.CanAddNew IEditableCollectionView.CanAddNew IEditableCollectionView.CanAddNew IEditableCollectionView.CanAddNew

获取一个值,该值指示是否可以将新项添加到集合中。Gets a value that indicates whether a new item can be added to the collection.

IEditableCollectionView.CanCancelEdit IEditableCollectionView.CanCancelEdit IEditableCollectionView.CanCancelEdit IEditableCollectionView.CanCancelEdit

获取一个值,该值指示集合视图是否可以放弃挂起的更改并还原所编辑对象的原始值。Gets a value that indicates whether the collection view can discard pending changes and restore the original values of an edited object.

IEditableCollectionView.CancelEdit() IEditableCollectionView.CancelEdit() IEditableCollectionView.CancelEdit() IEditableCollectionView.CancelEdit()

结束编辑事务,并还原项的原始值(如有可能)。Ends the edit transaction and, if possible, restores the original value to the item.

IEditableCollectionView.CancelNew() IEditableCollectionView.CancelNew() IEditableCollectionView.CancelNew() IEditableCollectionView.CancelNew()

结束添加事务并放弃挂起的新项。Ends the add transaction and discards the pending new item.

IEditableCollectionView.CanRemove IEditableCollectionView.CanRemove IEditableCollectionView.CanRemove IEditableCollectionView.CanRemove

获取一个值,该值指示是否可以从集合中移除项。Gets a value that indicates whether an item can be removed from the collection.

IEditableCollectionView.CommitEdit() IEditableCollectionView.CommitEdit() IEditableCollectionView.CommitEdit() IEditableCollectionView.CommitEdit()

结束编辑事务并保存挂起的更改。Ends the edit transaction and saves the pending changes.

IEditableCollectionView.CommitNew() IEditableCollectionView.CommitNew() IEditableCollectionView.CommitNew() IEditableCollectionView.CommitNew()

结束添加事务并保存挂起的新项。Ends the add transaction and saves the pending new item.

IEditableCollectionView.CurrentAddItem IEditableCollectionView.CurrentAddItem IEditableCollectionView.CurrentAddItem IEditableCollectionView.CurrentAddItem

获取正在当前添加事务过程中添加的项。Gets the item that is being added during the current add transaction.

IEditableCollectionView.CurrentEditItem IEditableCollectionView.CurrentEditItem IEditableCollectionView.CurrentEditItem IEditableCollectionView.CurrentEditItem

获取集合中正在编辑的项。Gets the item in the collection that is being edited.

IEditableCollectionView.EditItem(Object) IEditableCollectionView.EditItem(Object) IEditableCollectionView.EditItem(Object) IEditableCollectionView.EditItem(Object)

开始指定项的编辑事务。Begins an edit transaction of the specified item.

IEditableCollectionView.IsAddingNew IEditableCollectionView.IsAddingNew IEditableCollectionView.IsAddingNew IEditableCollectionView.IsAddingNew

获取一个值,该值指示是否正在执行添加事务。Gets a value that indicates whether an add transaction is in progress.

IEditableCollectionView.IsEditingItem IEditableCollectionView.IsEditingItem IEditableCollectionView.IsEditingItem IEditableCollectionView.IsEditingItem

获取一个值,该值指示是否正在执行编辑事务。Gets a value that indicates whether an edit transaction is in progress.

IEditableCollectionView.NewItemPlaceholderPosition IEditableCollectionView.NewItemPlaceholderPosition IEditableCollectionView.NewItemPlaceholderPosition IEditableCollectionView.NewItemPlaceholderPosition

获取或设置集合视图中新项占位符的位置。Gets or sets the position of the new item placeholder in the collection view.

IEditableCollectionView.Remove(Object) IEditableCollectionView.Remove(Object) IEditableCollectionView.Remove(Object) IEditableCollectionView.Remove(Object)

从集合中移除指定的项。Removes the specified item from the collection.

IEditableCollectionView.RemoveAt(Int32) IEditableCollectionView.RemoveAt(Int32) IEditableCollectionView.RemoveAt(Int32) IEditableCollectionView.RemoveAt(Int32)

从集合中移除指定位置的项。Removes the item at the specified position from the collection.

IEditableCollectionViewAddNewItem.AddNewItem(Object) IEditableCollectionViewAddNewItem.AddNewItem(Object) IEditableCollectionViewAddNewItem.AddNewItem(Object) IEditableCollectionViewAddNewItem.AddNewItem(Object)

将指定的对象添加到集合。Adds the specified object to the collection.

IEditableCollectionViewAddNewItem.CanAddNewItem IEditableCollectionViewAddNewItem.CanAddNewItem IEditableCollectionViewAddNewItem.CanAddNewItem IEditableCollectionViewAddNewItem.CanAddNewItem

获取一个值,该值指示是否可以向集合中添加指定的对象。Gets a value that indicates whether a specified object can be added to the collection.

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

返回可用于枚举视图中的项的 IEnumerator 对象。Returns an IEnumerator object that you can use to enumerate the items in the view.

(Inherited from CollectionView)
IItemProperties.ItemProperties IItemProperties.ItemProperties IItemProperties.ItemProperties IItemProperties.ItemProperties

获取一个集合,该集合包含某集合中项的可用属性的相关信息。Gets a collection that contains information about the properties that are available on the items in a collection.

IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize

此成员支持 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基础结构,但不能在代码中直接使用。This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly

此成员支持 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基础结构,但不能在代码中直接使用。This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

IWeakEventListener.ReceiveWeakEvent(Type, Object, EventArgs) IWeakEventListener.ReceiveWeakEvent(Type, Object, EventArgs) IWeakEventListener.ReceiveWeakEvent(Type, Object, EventArgs) IWeakEventListener.ReceiveWeakEvent(Type, Object, EventArgs)

接收集中事件管理器中的事件。Receives events from the centralized event manager.

事件

CollectionChanged CollectionChanged CollectionChanged CollectionChanged

在视图更改时发生。Occurs when the view has changed.

(Inherited from CollectionView)
CurrentChanged CurrentChanged CurrentChanged CurrentChanged

CurrentItem 更改后发生。Occurs after the CurrentItem has changed.

(Inherited from CollectionView)
CurrentChanging CurrentChanging CurrentChanging CurrentChanging

CurrentItem 正在更改时发生。Occurs when the CurrentItem is changing.

(Inherited from CollectionView)
INotifyCollectionChanged.CollectionChanged INotifyCollectionChanged.CollectionChanged INotifyCollectionChanged.CollectionChanged INotifyCollectionChanged.CollectionChanged

在视图更改时发生。Occurs when the view has changed.

(Inherited from CollectionView)
INotifyPropertyChanged.PropertyChanged INotifyPropertyChanged.PropertyChanged INotifyPropertyChanged.PropertyChanged INotifyPropertyChanged.PropertyChanged

在属性值更改时发生。Occurs when a property value changes.

(Inherited from CollectionView)
PropertyChanged PropertyChanged PropertyChanged PropertyChanged

在更改属性值时发生。Occurs when a property value has changed.

(Inherited from CollectionView)

扩展方法

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于

另请参阅