CollectionViewSource 類別

定義

CollectionView 類別的 Extensible Application Markup Language (XAML) Proxy。

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
繼承
實作

備註

CollectionViewSource 是類別的 CollectionView Proxy,或衍生自 CollectionView 的類別。 CollectionViewSource 可讓 XAML 程式碼設定常用的 CollectionView 屬性,並將這些設定傳遞至基礎檢視。 CollectionViewSourceView具有保存實際檢視的屬性,以及 Source 保存來源集合的屬性。

您可以將集合檢視視為系結來源集合頂端的圖層,其可讓您根據排序、篩選和群組查詢來巡覽和顯示集合,而不需要操作基礎來源集合本身。 如果來源集合實作 INotifyCollectionChanged 介面,則 CollectionChanged 事件所引發的變更會散佈到檢視。

因為檢視不會變更基礎來源集合,每個來源集合可以有多個相關聯的檢視。 例如,您可能有 物件的集合 Task 。 使用檢視時,您可以不同方式顯示相同資料。 舉例來說,在頁面左方您可以顯示依優先順序排序的工作,右方顯示依區域分組的工作。

如需詳細資訊,請參閱資料繫結概觀中的<繫結至集合>一節。

建構函式

CollectionViewSource()

初始化 CollectionViewSource 類別的新執行個體。

欄位

CanChangeLiveFilteringProperty

識別 CanChangeLiveFiltering 相依性屬性。

CanChangeLiveGroupingProperty

識別 CanChangeLiveGrouping 相依性屬性。

CanChangeLiveSortingProperty

識別 CanChangeLiveSorting 相依性屬性。

CollectionViewTypeProperty

識別 CollectionViewType 相依性屬性。

IsLiveFilteringProperty

識別 IsLiveFiltering 相依性屬性。

IsLiveFilteringRequestedProperty

識別 IsLiveFilteringRequested 相依性屬性。

IsLiveGroupingProperty

識別 IsLiveGrouping 相依性屬性。

IsLiveGroupingRequestedProperty

識別 IsLiveGroupingRequested 相依性屬性。

IsLiveSortingProperty

識別 IsLiveSorting 相依性屬性。

IsLiveSortingRequestedProperty

識別 IsLiveSortingRequested 相依性屬性。

SourceProperty

識別 Source 相依性屬性。

ViewProperty

識別 View 相依性屬性。

屬性

CanChangeLiveFiltering

取得值,其中該值表示集合檢視是否支援即時開啟或關閉篩選資料。

CanChangeLiveGrouping

取得值,這個值表示這個集合檢視是否支援開啟或關閉即時群組資料功能。

CanChangeLiveSorting

取得值,這個值表示這個集合檢視是否支援開啟或關閉即時排序資料功能。

CollectionViewType

取得或設定所需的檢視型別。

Culture

取得或設定用於作業 (例如排序和比較) 的文化特性資訊。

DependencyObjectType

DependencyObjectType取得包裝這個實例之 CLR 型別的 。

(繼承來源 DependencyObject)
Dispatcher

取得與這個 Dispatcher 關聯的 DispatcherObject

(繼承來源 DispatcherObject)
GroupDescriptions

取得或設定 GroupDescription 物件的集合,這個集合描述如何在檢視中排序集合中的項目。

IsLiveFiltering

取得值,指出 CollectionViewSource 是否即時篩選資料。

IsLiveFilteringRequested

取得或設定值,指出 CollectionViewSource 是否應該即時篩選資料 (如果可以的話)。

IsLiveGrouping

取得值,指出 CollectionViewSource 是否即時將資料設為群組。

IsLiveGroupingRequested

取得或設定值,指出 CollectionViewSource 是否應該即時將資料分組 (如果可以的話)。

IsLiveSorting

取得值,指出 CollectionViewSource 是否即時排序資料。

IsLiveSortingRequested

取得或設定值,指出 CollectionViewSource 是否應該即時排序資料 (如果可以的話)。

IsSealed

取得值,這個值表示此執行個體目前是否已密封 (唯讀)。

(繼承來源 DependencyObject)
LiveFilteringProperties

取得字串集合,這些字串會指定參與即時篩選資料的屬性。

LiveGroupingProperties

取得字串集合,這些字串會指定參與即時篩群組資料的屬性。

LiveSortingProperties

取得字串集合,這些字串會指定參與即時排序資料的屬性。

SortDescriptions

取得或設定 SortDescription 物件的集合,這個集合描述如何在檢視中排序集合中的項目。

Source

取得或設定用來建立此檢視的集合物件。

View

取得目前與這個 CollectionViewSource 執行個體相關聯的檢視物件。

方法

CheckAccess()

判斷呼叫的執行是否可以存取這個 DispatcherObject

(繼承來源 DispatcherObject)
ClearValue(DependencyProperty)

清除屬性的區域數值。 要清除的屬性是由 DependencyProperty 識別項所指定。

(繼承來源 DependencyObject)
ClearValue(DependencyPropertyKey)

清除唯讀屬性的區域數值。 要清除的屬性是由 DependencyPropertyKey 所指定。

(繼承來源 DependencyObject)
CoerceValue(DependencyProperty)

強制轉型所指定相依性屬性的值。 完成方式是叫用存在於呼叫 DependencyObject 之相依性屬性的屬性中繼資料中所指定的任何 CoerceValueCallback 函式。

(繼承來源 DependencyObject)
DeferRefresh()

進入延後循環,您可以用來合併變更到檢視,並且延遲自動重新整理。

Equals(Object)

判斷提供的 DependencyObject 和目前的 DependencyObject 是否相等。

(繼承來源 DependencyObject)
GetDefaultView(Object)

傳回指定來源的預設檢視。

GetHashCode()

取得這個 DependencyObject 的雜湊碼。

(繼承來源 DependencyObject)
GetLocalValueEnumerator()

建立特定的列舉值,以判斷哪些相依性屬性在此 DependencyObject 上具有本機設定的值。

(繼承來源 DependencyObject)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
GetValue(DependencyProperty)

傳回 DependencyObject 的這個執行個體上之相依性屬性的目前有效值。

(繼承來源 DependencyObject)
InvalidateProperty(DependencyProperty)

重新評估指定相依性屬性的有效值。

(繼承來源 DependencyObject)
IsDefaultView(ICollectionView)

傳回值,這個值表示指定的檢視是否為 Source 集合的預設檢視。

MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
OnCollectionViewTypeChanged(Type, Type)

CollectionViewType 屬性變更時叫用。

OnPropertyChanged(DependencyPropertyChangedEventArgs)

每當這個 DependencyObject 上任何相依性屬性的有效值已更新時叫用。 已變更的特定相依性屬性會在事件資料中報告。

(繼承來源 DependencyObject)
OnSourceChanged(Object, Object)

Source 屬性變更時叫用。

ReadLocalValue(DependencyProperty)

傳回相依性屬性的區域值 (如果存在)。

(繼承來源 DependencyObject)
ReceiveWeakEvent(Type, Object, EventArgs)

從集中式事件資料表處理事件。

SetCurrentValue(DependencyProperty, Object)

設定相依性屬性的值,而不需要變更其值來源。

(繼承來源 DependencyObject)
SetValue(DependencyProperty, Object)

設定相依性屬性的區域值 (由相依性屬性的識別碼所指定)。

(繼承來源 DependencyObject)
SetValue(DependencyPropertyKey, Object)

設定唯讀相依性屬性的區域數值 (由相依性屬性的 DependencyPropertyKey 識別項所指定)。

(繼承來源 DependencyObject)
ShouldSerializeProperty(DependencyProperty)

傳回值,這個值表示序列化程序是否應該序列化所提供相依性屬性的值。

(繼承來源 DependencyObject)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)
VerifyAccess()

請強制執行可以存取這個 DispatcherObject 的呼叫執行緒。

(繼承來源 DispatcherObject)

事件

Filter

提供篩選邏輯。

明確介面實作

ISupportInitialize.BeginInit()

表示物件正在啟動初始設定。

ISupportInitialize.EndInit()

表示物件已完成初始設定。

IWeakEventListener.ReceiveWeakEvent(Type, Object, EventArgs)

從集中式事件管理員接收事件。

適用於