BindingListCollectionView 类

定义

表示实现 IBindingList 的集合的 CollectionView,例如 Microsoft ActiveX 数据对象 (ADO) 数据视图。Represents the CollectionView for collections that implement IBindingList, such as Microsoft ActiveX Data Objects (ADO) data views.

public ref class BindingListCollectionView sealed : System::Windows::Data::CollectionView, System::Collections::IComparer, System::ComponentModel::ICollectionViewLiveShaping, System::ComponentModel::IEditableCollectionView, System::ComponentModel::IItemProperties
public ref class BindingListCollectionView sealed : System::Windows::Data::CollectionView, System::Collections::IComparer, System::ComponentModel::IEditableCollectionView, System::ComponentModel::IItemProperties
public sealed class BindingListCollectionView : System.Windows.Data.CollectionView, System.Collections.IComparer, System.ComponentModel.ICollectionViewLiveShaping, System.ComponentModel.IEditableCollectionView, System.ComponentModel.IItemProperties
public sealed class BindingListCollectionView : System.Windows.Data.CollectionView, System.Collections.IComparer, System.ComponentModel.IEditableCollectionView, System.ComponentModel.IItemProperties
type BindingListCollectionView = class
    inherit CollectionView
    interface IComparer
    interface ICollectionViewLiveShaping
    interface IEditableCollectionView
    interface IItemProperties
type BindingListCollectionView = class
    inherit CollectionView
    interface IComparer
    interface IEditableCollectionView
    interface IItemProperties
type BindingListCollectionView = class
    inherit CollectionView
    interface IComparer
    interface IEditableCollectionView
    interface ICollectionViewLiveShaping
    interface IItemProperties
Public NotInheritable Class BindingListCollectionView
Inherits CollectionView
Implements ICollectionViewLiveShaping, IComparer, IEditableCollectionView, IItemProperties
Public NotInheritable Class BindingListCollectionView
Inherits CollectionView
Implements IComparer, IEditableCollectionView, IItemProperties
继承
BindingListCollectionView
实现

注解

所有集合都具有默认值 CollectionViewAll collections have a default CollectionView. 对于实现或的 IBindingListView 集合 IBindingList ,默认集合视图为 BindingListCollectionViewFor collections that implement IBindingListView or IBindingList, the default collection view is BindingListCollectionView. 具体而言, IBindingList 是所必需的 BindingListCollectionView ,并且 IBindingListView 是提供附加排序和筛选支持的可选接口。Specifically, IBindingList is required for BindingListCollectionView, and IBindingListView is an optional interface that gives additional sorting and filtering support.

如果有多个 BindingListCollectionView 对象,并且基础源是 DataTableDataView ,则视图对象不会单独进行排序或筛选。If you have multiple BindingListCollectionView objects and the underlying source is a DataTable or a DataView, the view objects do not sort or filter independently. 例如,如果有两个 BindingListCollectionView 关联的对象,并且对 DataTable 其中一个视图执行排序,则其他视图中的项的顺序可能会受到影响。For example, if you have two BindingListCollectionView objects associated with the same DataTable and you perform sorting on one of the views, the order of items in the other view can be affected. 这是因为 BindingListCollectionView 对象使用基础 IBindingList 进行排序和筛选功能。This is because BindingListCollectionView objects use the underlying IBindingList for sorting and filtering functionalities.

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

构造函数

BindingListCollectionView(IBindingList)

根据给定的列表初始化 BindingListCollectionView 的实例。Initializes an instance of BindingListCollectionView over the given list.

属性

AllowsCrossThreadChanges

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

(继承自 CollectionView)
CanAddNew

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

CanCancelEdit

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

CanChangeLiveFiltering

获取指示此视图是否支持实时状态打开或关闭中筛选数据的值。Gets a value that indicates whether this view supports turning filtering data in real time on or off.

CanChangeLiveGrouping

获取指示视图是否支持实时状态打开或关闭中分组数据的值。Gets a value that indicates whether this view supports turning grouping data in real time on or off.

CanChangeLiveSorting

获取指示此视图是否支持实时状态打开或关闭中分类数据的值。Gets a value that indicates whether this view supports turning sorting data in real time on or off.

CanCustomFilter

获取一个值,该值指示视图是否支持自定义筛选。Gets a value that indicates whether the view supports custom filtering.

CanFilter

获取一个值,该值指示视图是否支持基于回调的筛选。Gets a value that indicates whether the view supports callback-based filtering.

CanGroup

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

CanRemove

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

CanSort

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

Comparer

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

(继承自 CollectionView)
Count

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

Culture

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

(继承自 CollectionView)
CurrentAddItem

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

CurrentEditItem

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

CurrentItem

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

(继承自 CollectionView)
CurrentPosition

获取 CurrentItem 在(可能经过排序和筛选)视图中的序号位置。Gets the ordinal position of the CurrentItem within the (optionally sorted and filtered) view.

(继承自 CollectionView)
CustomFilter

获取或设置自定义筛选器。Gets or sets a custom filter.

Dispatcher

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

(继承自 DispatcherObject)
Filter

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

(继承自 CollectionView)
GroupBySelector

获取或设置一个委托,用于将 GroupDescription 选作父组及其级别的功能。Gets or sets a delegate to select the GroupDescription as a function of the parent group and its level.

GroupDescriptions

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

Groups

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

IsAddingNew

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

IsCurrentAfterLast

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

(继承自 CollectionView)
IsCurrentBeforeFirst

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

(继承自 CollectionView)
IsCurrentInSync

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

(继承自 CollectionView)
IsDataInGroupOrder

获取或设置一个值,该值指示项列表在应用排序功能和筛选器(如果有)后是否已处于可以进行分组的正确顺序。Gets or sets a value that indicates whether the list of items (after applying the sort and filters, if any) is already in the correct order for grouping.

IsDynamic

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

(继承自 CollectionView)
IsEditingItem

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

IsEmpty

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

IsInUse

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

(继承自 CollectionView)
IsLiveFiltering

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

IsLiveGrouping

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

IsLiveSorting

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

IsRefreshDeferred

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

(继承自 CollectionView)
ItemProperties

获取一个对象集合,该集合描述集合中项的属性。Gets a collection of objects that describes the properties of the items in the collection.

LiveFilteringProperties

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

LiveGroupingProperties

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

LiveSortingProperties

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

NeedsRefresh

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

(继承自 CollectionView)
NewItemPlaceholderPosition

获取或设置新项占位符在 BindingListCollectionView 中的位置。Gets or sets the position of the new item placeholder in the BindingListCollectionView.

SortDescriptions

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

SourceCollection

返回未筛选的基础集合。Returns the underlying unfiltered collection.

(继承自 CollectionView)
UpdatedOutsideDispatcher

获取一个值,该值指示是否有必要更新更改日志,因为在 CollectionChanged 没有首先进入用户界面 (UI) 线程调度程序的情况下,已在其他线程上收到通知。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 user interface (UI) thread dispatcher.

(继承自 CollectionView)

方法

AddNew()

开始添加事务并返回挂起的新项。Starts an add transaction and returns the pending new item.

CancelEdit()

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

CancelNew()

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

CheckAccess()

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

(继承自 DispatcherObject)
ClearChangeLog()
已过时。

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

(继承自 CollectionView)
ClearPendingChanges()

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

(继承自 CollectionView)
CommitEdit()

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

CommitNew()

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

Contains(Object)

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

DeferRefresh()

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

(继承自 CollectionView)
DetachFromSourceCollection()

从该集合视图分离基础集合以启用回收垃圾集合视图。Detaches the underlying collection from this collection view to enable the collection view to be garbage collected.

DetachFromSourceCollection()

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

(继承自 CollectionView)
EditItem(Object)

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

Equals(Object)

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

(继承自 Object)
GetEnumerator()

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

(继承自 CollectionView)
GetHashCode()

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

(继承自 Object)
GetItemAt(Int32)

检索位于视图中指定位置的项。Retrieves the item at the specified position in the view.

GetType()

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

(继承自 Object)
IndexOf(Object)

返回给定项在集合视图中的索引。Returns the index at which the given item belongs in the collection view.

MemberwiseClone()

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

(继承自 Object)
MoveCurrentTo(Object)

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

(继承自 CollectionView)
MoveCurrentToFirst()

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

(继承自 CollectionView)
MoveCurrentToLast()

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

(继承自 CollectionView)
MoveCurrentToNext()

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

(继承自 CollectionView)
MoveCurrentToPosition(Int32)

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

MoveCurrentToPrevious()

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

(继承自 CollectionView)
OKToChangeCurrent()

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

(继承自 CollectionView)
OnAllowsCrossThreadChangesChanged()

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

(继承自 CollectionView)
OnBeginChangeLogging(NotifyCollectionChangedEventArgs)
已过时。

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

(继承自 CollectionView)
OnCollectionChanged(NotifyCollectionChangedEventArgs)

引发 CollectionChanged 事件。Raises the CollectionChanged event.

(继承自 CollectionView)
OnCollectionChanged(Object, NotifyCollectionChangedEventArgs)

引发 CollectionChanged 事件。Raises the CollectionChanged event.

(继承自 CollectionView)
OnCurrentChanged()

引发 CurrentChanged 事件。Raises the CurrentChanged event.

(继承自 CollectionView)
OnCurrentChanging()

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

(继承自 CollectionView)
OnCurrentChanging(CurrentChangingEventArgs)

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

(继承自 CollectionView)
OnPropertyChanged(PropertyChangedEventArgs)

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

(继承自 CollectionView)
PassesFilter(Object)

返回一个值,该值指示基础集合中的指定项是否属于视图。Returns a value that indicates whether the specified item in the underlying collection belongs to the view.

ProcessCollectionChanged(NotifyCollectionChangedEventArgs)

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

(继承自 CollectionView)
ProcessPendingChanges()

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

(继承自 CollectionView)
Refresh()

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

(继承自 CollectionView)
RefreshOrDefer()

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

(继承自 CollectionView)
RefreshOverride()

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

(继承自 CollectionView)
Remove(Object)

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

RemoveAt(Int32)

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

SetCurrent(Object, Int32)

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

(继承自 CollectionView)
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.

(继承自 CollectionView)
ToString()

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

(继承自 Object)
VerifyAccess()

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

(继承自 DispatcherObject)

事件

CollectionChanged

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

(继承自 CollectionView)
CurrentChanged

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

(继承自 CollectionView)
CurrentChanging

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

(继承自 CollectionView)
PropertyChanged

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

(继承自 CollectionView)

显式接口实现

IComparer.Compare(Object, Object)

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

IEnumerable.GetEnumerator()

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

(继承自 CollectionView)
INotifyCollectionChanged.CollectionChanged

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

(继承自 CollectionView)
INotifyPropertyChanged.PropertyChanged

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

(继承自 CollectionView)

扩展方法

Cast<TResult>(IEnumerable)

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

OfType<TResult>(IEnumerable)

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

AsParallel(IEnumerable)

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

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于