CollectionViewSource CollectionViewSource CollectionViewSource CollectionViewSource Class

定義

CollectionView 類別的 Extensible Application Markup Language (XAML) Proxy。The Extensible Application Markup Language (XAML) proxy of a CollectionView class.

public ref class CollectionViewSource : System::Windows::DependencyObject, System::ComponentModel::ISupportInitialize, System::Windows::IWeakEventListener
public class CollectionViewSource : System.Windows.DependencyObject, System.ComponentModel.ISupportInitialize, System.Windows.IWeakEventListener
type CollectionViewSource = class
    inherit DependencyObject
    interface ISupportInitialize
    interface IWeakEventListener
Public Class CollectionViewSource
Inherits DependencyObject
Implements ISupportInitialize, IWeakEventListener
繼承
實作

備註

CollectionViewSourceCollectionView類別的 proxy, 或是衍生自CollectionView的類別。CollectionViewSource is a proxy for a CollectionView class, or a class derived from CollectionView. CollectionViewSourceXAMLXAML讓程式碼設定CollectionView常用的屬性, 並將這些設定傳遞至基礎視圖。CollectionViewSource enables XAMLXAML code to set the commonly used CollectionView properties, passing these settings to the underlying view. CollectionViewSource具有屬性, 其中包含實際的視圖Source和保存來源集合的屬性。 ViewCollectionViewSource has a View property that holds the actual view and a Source property that holds the source collection.

您可以將集合視圖視為系結來源集合頂端的圖層, 讓您可以根據排序、篩選和群組查詢來流覽和顯示集合, 而不需要操作基礎來源集合本身。You can think of a collection view as the layer on top of the binding source collection that allows you to navigate and display the collection based on sort, filter, and group queries, all without having to manipulate the underlying source collection itself. 如果來源集合INotifyCollectionChanged會執行介面, CollectionChanged事件所引發的變更就會傳播至 views。If the source collection implements the INotifyCollectionChanged interface, the changes raised by the CollectionChanged event are propagated to the views.

因為檢視不會變更基礎來源集合,每個來源集合可以有多個相關聯的檢視。Because views do not change the underlying source collections, each source collection can have multiple views associated with it. 例如, 您可能會有Task物件的集合。For example, you may have a collection of Task objects. 使用檢視時,您可以不同方式顯示相同資料。With the use of views, you can display that same data in different ways. 舉例來說,在頁面左方您可以顯示依優先順序排序的工作,右方顯示依區域分組的工作。For example, on the left side of your page you may want to show tasks sorted by priority, and on the right side, grouped by area.

如需詳細資訊,請參閱資料繫結概觀中的<繫結至集合>一節。For more information, see the Binding to Collections section in the Data Binding Overview.

建構函式

CollectionViewSource() CollectionViewSource() CollectionViewSource() CollectionViewSource()

初始化 CollectionViewSource 類別的新執行個體。Initializes a new instance of the CollectionViewSource class.

欄位

CanChangeLiveFilteringProperty CanChangeLiveFilteringProperty CanChangeLiveFilteringProperty CanChangeLiveFilteringProperty

識別 CanChangeLiveFiltering 相依性屬性。Identifies the CanChangeLiveFiltering dependency property.

CanChangeLiveGroupingProperty CanChangeLiveGroupingProperty CanChangeLiveGroupingProperty CanChangeLiveGroupingProperty

識別 CanChangeLiveGrouping 相依性屬性。Identifies the CanChangeLiveGrouping dependency property.

CanChangeLiveSortingProperty CanChangeLiveSortingProperty CanChangeLiveSortingProperty CanChangeLiveSortingProperty

識別 CanChangeLiveSorting 相依性屬性。Identifies the CanChangeLiveSorting dependency property.

CollectionViewTypeProperty CollectionViewTypeProperty CollectionViewTypeProperty CollectionViewTypeProperty

識別 CollectionViewType 相依性屬性。Identifies the CollectionViewType dependency property.

IsLiveFilteringProperty IsLiveFilteringProperty IsLiveFilteringProperty IsLiveFilteringProperty

識別 IsLiveFiltering 相依性屬性。Identifies the IsLiveFiltering dependency property.

IsLiveFilteringRequestedProperty IsLiveFilteringRequestedProperty IsLiveFilteringRequestedProperty IsLiveFilteringRequestedProperty

識別 IsLiveFilteringRequested 相依性屬性。Identifies the IsLiveFilteringRequested dependency property.

IsLiveGroupingProperty IsLiveGroupingProperty IsLiveGroupingProperty IsLiveGroupingProperty

識別 IsLiveGrouping 相依性屬性。Identifies the IsLiveGrouping dependency property.

IsLiveGroupingRequestedProperty IsLiveGroupingRequestedProperty IsLiveGroupingRequestedProperty IsLiveGroupingRequestedProperty

識別 IsLiveGroupingRequested 相依性屬性。Identifies the IsLiveGroupingRequested dependency property.

IsLiveSortingProperty IsLiveSortingProperty IsLiveSortingProperty IsLiveSortingProperty

識別 IsLiveSorting 相依性屬性。Identifies the IsLiveSorting dependency property.

IsLiveSortingRequestedProperty IsLiveSortingRequestedProperty IsLiveSortingRequestedProperty IsLiveSortingRequestedProperty

識別 IsLiveSortingRequested 相依性屬性。Identifies the IsLiveSortingRequested dependency property.

SourceProperty SourceProperty SourceProperty SourceProperty

識別 Source 相依性屬性。Identifies the Source dependency property.

ViewProperty ViewProperty ViewProperty ViewProperty

識別 CollectionViewType 相依性屬性。Identifies the CollectionViewType dependency property.

屬性

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.

CollectionViewType CollectionViewType CollectionViewType CollectionViewType

取得或設定所需的檢視型別。Gets or sets the desired view type.

Culture Culture Culture Culture

取得或設定用於作業 (例如排序和比較) 的文化特性資訊。Gets or sets the culture that is used for operations such as sorting and comparisons.

DependencyObjectType DependencyObjectType DependencyObjectType DependencyObjectType

取得包裝此執行個體之 CLRCLR 型別的 DependencyObjectTypeGets the DependencyObjectType that wraps the CLRCLR type of this instance.

(Inherited from DependencyObject)
Dispatcher Dispatcher Dispatcher Dispatcher

取得與這個 Dispatcher 關聯的 DispatcherObjectGets the Dispatcher this DispatcherObject is associated with.

(Inherited from DispatcherObject)
GroupDescriptions GroupDescriptions GroupDescriptions GroupDescriptions

取得或設定 GroupDescription 物件的集合,這個集合描述如何在檢視中排序集合中的項目。Gets or sets a collection of GroupDescription objects that describes how the items in the collection are grouped in the view.

IsLiveFiltering IsLiveFiltering IsLiveFiltering IsLiveFiltering

取得值,指出 CollectionViewSource 是否即時篩選資料。Gets a value that indicates whether the CollectionViewSource is filtering data in real time.

IsLiveFilteringRequested IsLiveFilteringRequested IsLiveFilteringRequested IsLiveFilteringRequested

取得或設定值,指出 CollectionViewSource 是否應該即時篩選資料 (如果可以的話)。Gets or sets a value that indicates whether CollectionViewSource should filter the data in real time if it can.

IsLiveGrouping IsLiveGrouping IsLiveGrouping IsLiveGrouping

取得值,指出 CollectionViewSource 是否即時將資料設為群組。Gets a value that indicates whether the CollectionViewSource groups data in real time.

IsLiveGroupingRequested IsLiveGroupingRequested IsLiveGroupingRequested IsLiveGroupingRequested

取得或設定值,指出 CollectionViewSource 是否應該即時將資料分組 (如果可以的話)。Gets or sets a value that indicates whether CollectionViewSource should group the data in real time if it can.

IsLiveSorting IsLiveSorting IsLiveSorting IsLiveSorting

取得值,指出 CollectionViewSource 是否即時排序資料。Gets a value that indicates whether the CollectionViewSource sorts data in real time.

IsLiveSortingRequested IsLiveSortingRequested IsLiveSortingRequested IsLiveSortingRequested

取得或設定值,指出 CollectionViewSource 是否應該即時排序資料 (如果可以的話)。Gets or sets a value that indicates whether CollectionViewSource should sort the data in real time if it can.

IsSealed IsSealed IsSealed IsSealed

取得值,這個值表示此執行個體目前是否已密封 (唯讀)。Gets a value that indicates whether this instance is currently sealed (read-only).

(Inherited from DependencyObject)
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.

SortDescriptions SortDescriptions SortDescriptions SortDescriptions

取得或設定 SortDescription 物件的集合,這個集合描述如何在檢視中排序集合中的項目。Gets or sets a collection of SortDescription objects that describes how the items in the collection are sorted in the view.

Source Source Source Source

取得或設定用來建立此檢視的集合物件。Gets or sets the collection object from which to create this view.

View View View View

取得目前與這個 CollectionViewSource 執行個體相關聯的檢視物件。Gets the view object that is currently associated with this instance of CollectionViewSource.

方法

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

判斷呼叫的執行是否可以存取這個 DispatcherObjectDetermines whether the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)
ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty)

清除屬性的區域數值。Clears the local value of a property. 要清除的屬性是由 DependencyProperty 識別項所指定。The property to be cleared is specified by a DependencyProperty identifier.

(Inherited from DependencyObject)
ClearValue(DependencyPropertyKey) ClearValue(DependencyPropertyKey) ClearValue(DependencyPropertyKey) ClearValue(DependencyPropertyKey)

清除唯讀屬性的區域數值。Clears the local value of a read-only property. 要清除的屬性是由 DependencyPropertyKey 所指定。The property to be cleared is specified by a DependencyPropertyKey.

(Inherited from DependencyObject)
CoerceValue(DependencyProperty) CoerceValue(DependencyProperty) CoerceValue(DependencyProperty) CoerceValue(DependencyProperty)

強制轉型所指定相依性屬性的值。Coerces the value of the specified dependency property. 叫用存在於呼叫 CoerceValueCallback 上相依性屬性之屬性中繼資料內所指定的任何 DependencyObject 函式,就可以達到這一點。This is accomplished by invoking any CoerceValueCallback function specified in property metadata for the dependency property as it exists on the calling DependencyObject.

(Inherited from DependencyObject)
DeferRefresh() DeferRefresh() DeferRefresh() DeferRefresh()

進入延後循環,您可以用來合併變更到檢視,並且延遲自動重新整理。Enters a defer cycle that you can use to merge changes to the view and delay automatic refresh.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷提供的 DependencyObject 和目前的 DependencyObject 是否相等。Determines whether a provided DependencyObject is equivalent to the current DependencyObject.

(Inherited from DependencyObject)
GetDefaultView(Object) GetDefaultView(Object) GetDefaultView(Object) GetDefaultView(Object)

傳回指定來源的預設檢視。Returns the default view for the given source.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

取得這個 DependencyObject 的雜湊程式碼。Gets a hash code for this DependencyObject.

(Inherited from DependencyObject)
GetLocalValueEnumerator() GetLocalValueEnumerator() GetLocalValueEnumerator() GetLocalValueEnumerator()

建立特定的列舉值,以判斷哪些相依性屬性在此 DependencyObject 上具有本機設定的值。Creates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject.

(Inherited from DependencyObject)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty)

傳回 DependencyObject 的這個執行個體上之相依性屬性的目前有效值。Returns the current effective value of a dependency property on this instance of a DependencyObject.

(Inherited from DependencyObject)
InvalidateProperty(DependencyProperty) InvalidateProperty(DependencyProperty) InvalidateProperty(DependencyProperty) InvalidateProperty(DependencyProperty)

重新評估指定之相依性屬性的有效值。Re-evaluates the effective value for the specified dependency property

(Inherited from DependencyObject)
IsDefaultView(ICollectionView) IsDefaultView(ICollectionView) IsDefaultView(ICollectionView) IsDefaultView(ICollectionView)

傳回值,這個值表示指定的檢視是否為 Source 集合的預設檢視。Returns a value that indicates whether the given view is the default view for the Source collection.

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

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
OnCollectionViewTypeChanged(Type, Type) OnCollectionViewTypeChanged(Type, Type) OnCollectionViewTypeChanged(Type, Type) OnCollectionViewTypeChanged(Type, Type)

CollectionViewType 屬性變更時叫用。Invoked when the CollectionViewType property changes.

OnPropertyChanged(DependencyPropertyChangedEventArgs) OnPropertyChanged(DependencyPropertyChangedEventArgs) OnPropertyChanged(DependencyPropertyChangedEventArgs) OnPropertyChanged(DependencyPropertyChangedEventArgs)

每當這個 DependencyObject 上任何相依性屬性的有效值已更新時叫用。Invoked whenever the effective value of any dependency property on this DependencyObject has been updated. 已變更的特定相依性屬性會在事件資料中報告。The specific dependency property that changed is reported in the event data.

(Inherited from DependencyObject)
OnSourceChanged(Object, Object) OnSourceChanged(Object, Object) OnSourceChanged(Object, Object) OnSourceChanged(Object, Object)

Source 屬性變更時叫用。Invoked when the Source property changes.

ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty)

傳回相依性屬性的區域值 (如果存在)。Returns the local value of a dependency property, if it exists.

(Inherited from DependencyObject)
ReceiveWeakEvent(Type, Object, EventArgs) ReceiveWeakEvent(Type, Object, EventArgs) ReceiveWeakEvent(Type, Object, EventArgs) ReceiveWeakEvent(Type, Object, EventArgs)

從集中式事件資料表處理事件。Handles events from the centralized event table.

SetCurrentValue(DependencyProperty, Object) SetCurrentValue(DependencyProperty, Object) SetCurrentValue(DependencyProperty, Object) SetCurrentValue(DependencyProperty, Object)

設定相依性屬性的值,而不需要變更其值來源。Sets the value of a dependency property without changing its value source.

(Inherited from DependencyObject)
SetValue(DependencyProperty, Object) SetValue(DependencyProperty, Object) SetValue(DependencyProperty, Object) SetValue(DependencyProperty, Object)

設定相依性屬性的區域值 (由相依性屬性的識別碼所指定)。Sets the local value of a dependency property, specified by its dependency property identifier.

(Inherited from DependencyObject)
SetValue(DependencyPropertyKey, Object) SetValue(DependencyPropertyKey, Object) SetValue(DependencyPropertyKey, Object) SetValue(DependencyPropertyKey, Object)

設定唯讀相依性屬性的區域數值 (由相依性屬性的 DependencyPropertyKey 識別項所指定)。Sets the local value of a read-only dependency property, specified by the DependencyPropertyKey identifier of the dependency property.

(Inherited from DependencyObject)
ShouldSerializeProperty(DependencyProperty) ShouldSerializeProperty(DependencyProperty) ShouldSerializeProperty(DependencyProperty) ShouldSerializeProperty(DependencyProperty)

傳回值,這個值表示序列化程序是否應該序列化所提供相依性屬性的值。Returns a value that indicates whether serialization processes should serialize the value for the provided dependency property.

(Inherited from DependencyObject)
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)

事件

Filter Filter Filter Filter

提供篩選邏輯。Provides filtering logic.

明確介面實作

ISupportInitialize.BeginInit() ISupportInitialize.BeginInit() ISupportInitialize.BeginInit() ISupportInitialize.BeginInit()

表示物件正在啟動初始設定。Signals the object that initialization is starting.

ISupportInitialize.EndInit() ISupportInitialize.EndInit() ISupportInitialize.EndInit() ISupportInitialize.EndInit()

表示物件已完成初始設定。Signals the object that initialization is complete.

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.

適用於