CollectionViewSource Class

Definition

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
Inheritance
Implements

Remarks

CollectionViewSource is a proxy for a CollectionView class, or a class derived from CollectionView. CollectionViewSource enables XAML code to set the commonly used CollectionView properties, passing these settings to the underlying view. CollectionViewSource 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. 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. 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.

Constructors

Name Description
CollectionViewSource()

Initializes a new instance of the CollectionViewSource class.

Fields

Name Description
CanChangeLiveFilteringProperty

Identifies the CanChangeLiveFiltering dependency property.

CanChangeLiveGroupingProperty

Identifies the CanChangeLiveGrouping dependency property.

CanChangeLiveSortingProperty

Identifies the CanChangeLiveSorting dependency property.

CollectionViewTypeProperty

Identifies the CollectionViewType dependency property.

IsLiveFilteringProperty

Identifies the IsLiveFiltering dependency property.