Uređivanje

Dijeli putem


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

CollectionViewSource()

Initializes a new instance of the CollectionViewSource class.

Fields

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.

IsLiveFilteringRequestedProperty

Identifies the IsLiveFilteringRequested dependency property.

IsLiveGroupingProperty

Identifies the IsLiveGrouping dependency property.

IsLiveGroupingRequestedProperty

Identifies the IsLiveGroupingRequested dependency property.

IsLiveSortingProperty

Identifies the IsLiveSorting dependency property.

IsLiveSortingRequestedProperty

Identifies the IsLiveSortingRequested dependency property.

SourceProperty

Identifies the Source dependency property.

ViewProperty

Identifies the View dependency property.

Properties

CanChangeLiveFiltering

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

CanChangeLiveGrouping

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

CanChangeLiveSorting

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

CollectionViewType

Gets or sets the desired view type.

Culture

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

DependencyObjectType

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

(Inherited from DependencyObject)
Dispatcher

Gets the Dispatcher this DispatcherObject is associated with.

(Inherited from DispatcherObject)
GroupDescriptions

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

IsLiveFiltering

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

IsLiveFilteringRequested

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

IsLiveGrouping

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

IsLiveGroupingRequested

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

IsLiveSorting

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

IsLiveSortingRequested

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

IsSealed

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

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

SortDescriptions

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

Source

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

View

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

Methods

CheckAccess()

Determines whether the calling thread has access to this DispatcherObject.

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

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

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

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

Equals(Object)

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

(Inherited from DependencyObject)
GetDefaultView(Object)

Returns the default view for the given source.

GetHashCode()

Gets a hash code for this DependencyObject.

(Inherited from DependencyObject)
GetLocalValueEnumerator()

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

(Inherited from DependencyObject)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
GetValue(DependencyProperty)

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

(Inherited from DependencyObject)
InvalidateProperty(DependencyProperty)

Re-evaluates the effective value for the specified dependency property.

(Inherited from DependencyObject)
IsDefaultView(ICollectionView)

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

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
OnCollectionViewTypeChanged(Type, Type)

Invoked when the CollectionViewType property changes.

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)

Invoked when the Source property changes.

ReadLocalValue(DependencyProperty)

Returns the local value of a dependency property, if it exists.

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

Handles events from the centralized event table.

SetCurrentValue(DependencyProperty, Object)

Sets the value of a dependency property without changing its value source.

(Inherited from DependencyObject)
SetValue(DependencyProperty, Object)

Sets the local value of a dependency property, specified by its dependency property identifier.

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

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

(Inherited from DependencyObject)
ToString()

Returns a string that represents the current object.

(Inherited from Object)
VerifyAccess()

Enforces that the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)

Events

Filter

Provides filtering logic.

Explicit Interface Implementations

ISupportInitialize.BeginInit()

Signals the object that initialization is starting.

ISupportInitialize.EndInit()

Signals the object that initialization is complete.

IWeakEventListener.ReceiveWeakEvent(Type, Object, EventArgs)

Receives events from the centralized event manager.

Applies to