CollectionViewSource CollectionViewSource 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
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

CollectionViewSource() CollectionViewSource() CollectionViewSource()

Initializes a new instance of the CollectionViewSource class.

Fields

CanChangeLiveFilteringProperty CanChangeLiveFilteringProperty CanChangeLiveFilteringProperty

Identifies the CanChangeLiveFiltering dependency property.

CanChangeLiveGroupingProperty CanChangeLiveGroupingProperty CanChangeLiveGroupingProperty

Identifies the CanChangeLiveGrouping dependency property.

CanChangeLiveSortingProperty CanChangeLiveSortingProperty CanChangeLiveSortingProperty

Identifies the CanChangeLiveSorting dependency property.

CollectionViewTypeProperty CollectionViewTypeProperty CollectionViewTypeProperty

Identifies the CollectionViewType dependency property.

IsLiveFilteringProperty IsLiveFilteringProperty IsLiveFilteringProperty

Identifies the IsLiveFiltering dependency property.

IsLiveFilteringRequestedProperty IsLiveFilteringRequestedProperty IsLiveFilteringRequestedProperty

Identifies the IsLiveFilteringRequested dependency property.

IsLiveGroupingProperty IsLiveGroupingProperty IsLiveGroupingProperty

Identifies the IsLiveGrouping dependency property.

IsLiveGroupingRequestedProperty IsLiveGroupingRequestedProperty IsLiveGroupingRequestedProperty

Identifies the IsLiveGroupingRequested dependency property.

IsLiveSortingProperty IsLiveSortingProperty IsLiveSortingProperty

Identifies the IsLiveSorting dependency property.

IsLiveSortingRequestedProperty IsLiveSortingRequestedProperty IsLiveSortingRequestedProperty

Identifies the IsLiveSortingRequested dependency property.

SourceProperty SourceProperty SourceProperty

Identifies the Source dependency property.

ViewProperty ViewProperty ViewProperty

Identifies the CollectionViewType dependency property.

Properties

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

Gets a value that indicates whether the collection view supports turning grouping data in real time on or off.

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

Gets or sets the desired view type.

Culture Culture Culture

Gets or sets the culture that is used for operations such as sorting and comparisons.

DependencyObjectType DependencyObjectType DependencyObjectType

Gets the DependencyObjectType that wraps the CLR type of this instance.

(Inherited from DependencyObject)
Dispatcher Dispatcher Dispatcher

Gets the Dispatcher this DispatcherObject is associated with.

(Inherited from DispatcherObject)
GroupDescriptions GroupDescriptions GroupDescriptions

Gets or sets a collection of GroupDescription objects that describes how the items in the collection are grouped in the view.

IsLiveFiltering IsLiveFiltering IsLiveFiltering

Gets a value that indicates whether the CollectionViewSource is filtering data in real time.

IsLiveFilteringRequested IsLiveFilteringRequested IsLiveFilteringRequested

Gets or sets a value that indicates whether CollectionViewSource should filter the data in real time if it can.

IsLiveGrouping IsLiveGrouping IsLiveGrouping

Gets a value that indicates whether the CollectionViewSource groups data in real time.

IsLiveGroupingRequested IsLiveGroupingRequested IsLiveGroupingRequested

Gets or sets a value that indicates whether CollectionViewSource should group the data in real time if it can.

IsLiveSorting IsLiveSorting IsLiveSorting

Gets a value that indicates whether the CollectionViewSource sorts data in real time.

IsLiveSortingRequested IsLiveSortingRequested IsLiveSortingRequested

Gets or sets a value that indicates whether CollectionViewSource should sort the data in real time if it can.

IsSealed IsSealed IsSealed

Gets a value that indicates whether this instance is currently sealed (read-only).

(Inherited from DependencyObject)
LiveFilteringProperties LiveFilteringProperties LiveFilteringProperties

Gets a collection of strings that specify the properties that participate in filtering data in real time.

LiveGroupingProperties LiveGroupingProperties LiveGroupingProperties

Gets a collection of strings that specify the properties that participate in grouping data in real time.

LiveSortingProperties LiveSortingProperties LiveSortingProperties

Gets a collection of strings that specify the properties that participate in sorting data in real time.

SortDescriptions SortDescriptions SortDescriptions

Gets or sets a collection of SortDescription objects that describes how the items in the collection are sorted in the view.

Source Source Source

Gets or sets the collection object from which to create this view.

View View View

Gets the view object that is currently associated with this instance of CollectionViewSource.

Methods

CheckAccess() CheckAccess() CheckAccess()

Determines whether the calling thread has access to this DispatcherObject.

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

Clears the local value of a property. The property to be cleared is specified by a DependencyProperty identifier.

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

Clears the local value of a read-only property. The property to be cleared is specified by a DependencyPropertyKey.

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

Coerces the value of the specified dependency property. 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()

Enters a defer cycle that you can use to merge changes to the view and delay automatic refresh.

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

Determines whether a provided DependencyObject is equivalent to the current DependencyObject.

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

Returns the default view for the given source.

GetHashCode() GetHashCode() GetHashCode()

Gets a hash code for this DependencyObject.

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

Creates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject.

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

Gets the Type of the current instance.

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

Returns the current effective value of a dependency property on this instance of a DependencyObject.

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

Returns a value that indicates whether the given view is the default view for the Source collection.

MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

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

Invoked when the CollectionViewType property changes.

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

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)

Invoked when the Source property changes.

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)

Handles events from the centralized event table.

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)

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)

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)

Returns a value that indicates whether serialization processes should serialize the value for the provided dependency property.

(Inherited from DependencyObject)
ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
VerifyAccess() VerifyAccess() VerifyAccess()

Enforces that the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)

Events

Filter Filter Filter

Provides filtering logic.

Explicit Interface Implementations

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

Signals the object that initialization is starting.

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)

Receives events from the centralized event manager.

Applies to