ICollectionView ICollectionView ICollectionView ICollectionView Interface

定义

使集合具有当前记录管理、自定义排序、筛选和分组功能。Enables collections to have the functionalities of current record management, custom sorting, filtering, and grouping.

public interface class ICollectionView : System::Collections::IEnumerable, System::Collections::Specialized::INotifyCollectionChanged
public interface ICollectionView : System.Collections.IEnumerable, System.Collections.Specialized.INotifyCollectionChanged
type ICollectionView = interface
    interface IEnumerable
    interface INotifyCollectionChanged
Public Interface ICollectionView
Implements IEnumerable, INotifyCollectionChanged
派生
实现

注解

接口由CollectionView类实现, 该类是BindingListCollectionViewListCollectionViewItemCollection的基类。The interface is implemented by the CollectionView class, which is the base class for BindingListCollectionView, ListCollectionView, and ItemCollection.

属性

CanFilter CanFilter CanFilter CanFilter

获取一个值,该值指示此视图是否支持通过 Filter 属性进行筛选。Gets a value that indicates whether this view supports filtering via the Filter property.

CanGroup CanGroup CanGroup CanGroup

获取一个值,该值指示此视图是否支持通过 GroupDescriptions 属性进行分组。Gets a value that indicates whether this view supports grouping via the GroupDescriptions property.

CanSort CanSort CanSort CanSort

获取一个值,该值指示此视图是否支持通过 SortDescriptions 属性进行排序。Gets a value that indicates whether this view supports sorting via the SortDescriptions property.

Culture Culture Culture Culture

获取或设置根据区域性而可能不同的视图的任何操作(如排序)的区域性信息。Gets or sets the cultural info for any operations of the view that may differ by culture, such as sorting.

CurrentItem CurrentItem CurrentItem CurrentItem

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

CurrentPosition CurrentPosition CurrentPosition CurrentPosition

获取视图中 CurrentItem 的序号位置。Gets the ordinal position of the CurrentItem within the view.

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 describe how the items in the collection are grouped in the view.

Groups Groups Groups Groups

获取顶级组。Gets the top-level groups.

IsCurrentAfterLast IsCurrentAfterLast IsCurrentAfterLast IsCurrentAfterLast

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

IsCurrentBeforeFirst IsCurrentBeforeFirst IsCurrentBeforeFirst IsCurrentBeforeFirst

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

IsEmpty IsEmpty IsEmpty IsEmpty

返回一个值,该值指示获得的视图是否为空。Returns a value that indicates whether the resulting view is empty.

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

返回基础集合。Returns the underlying collection.

方法

Contains(Object) Contains(Object) Contains(Object) Contains(Object)

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

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

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

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

返回循环访问集合的枚举数。Returns an enumerator that iterates through a collection.

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

将指定项设置为视图中的 CurrentItemSets the specified item to be the CurrentItem in the view.

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.

Refresh() Refresh() Refresh() Refresh()

重新创建该视图。Recreates the view.

事件

CollectionChanged CollectionChanged CollectionChanged CollectionChanged

当集合更改时发生。Occurs when the collection changes.

(Inherited from INotifyCollectionChanged)
CurrentChanged CurrentChanged CurrentChanged CurrentChanged

在实现此接口时,在当前项改变之后引发此事件。When implementing this interface, raise this event after the current item has been changed.

CurrentChanging CurrentChanging CurrentChanging CurrentChanging

在实现此接口时,在改变当前项前引发此事件。When implementing this interface, raise this event before changing the current item. 事件处理程序可以取消此事件。Event handler can cancel this event.

扩展方法

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.

适用于

另请参阅