Class CollectionViewSource
The XAML proxy of a collection view class.
Implements
Inherited Members
Namespace: System.Windows.Data
Assembly: OpenSilver.dll
Syntax
public class CollectionViewSource : DependencyObject, ISupportInitialize
Constructors
| Improve this Doc View SourceCollectionViewSource()
Initializes a new instance of the CollectionViewSource class.
Declaration
public CollectionViewSource()
Fields
| Improve this Doc View SourceSourceProperty
Identifies Source dependency property.
Declaration
public static readonly DependencyProperty SourceProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ViewProperty
Identifies the View dependency property.
Declaration
public static readonly DependencyProperty ViewProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceCulture
Gets or sets the cultural information for any operations of the view that might differ by culture, such as sorting.
Declaration
public CultureInfo Culture { get; set; }
Property Value
Type | Description |
---|---|
System.Globalization.CultureInfo |
GroupDescriptions
Gets a collection of GroupDescription objects that describe how items in the collection are grouped in the view.
Declaration
public ObservableCollection<GroupDescription> GroupDescriptions { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<GroupDescription> |
SortDescriptions
Gets a collection of SortDescription objects that describe how the items in the collection are sorted in the view.
Declaration
public SortDescriptionCollection SortDescriptions { get; }
Property Value
Type | Description |
---|---|
SortDescriptionCollection |
Source
Gets or sets the collection object from which to create this view.
Declaration
public object Source { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The collection object from which to create this view. The default is null. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | The specified value when setting this property is not null or an System.Collections.IEnumerable implementation.-or-The specified value when setting this property is an ICollectionView implementation. |
System.InvalidOperationException | The specified value implements ICollectionViewFactory but its CreateView() method returns an ICollectionView with one or more of the following inconsistencies:CanFilter is false but Filter is not null.CanSort is false but SortDescriptions is not empty.CanGroup is false but GroupDescriptions is not empty. |
View
Gets the view object that is currently associated with this instance of CollectionViewSource.
Declaration
public ICollectionView View { get; }
Property Value
Type | Description |
---|---|
ICollectionView | The view object that is currently associated with this instance of CollectionViewSource. |
Methods
| Improve this Doc View SourceDeferRefresh()
Enters a defer cycle that you can use to merge changes to the view and delay automatic refresh.
Declaration
public IDisposable DeferRefresh()
Returns
Type | Description |
---|---|
System.IDisposable |
OnCollectionViewTypeChanged(Type, Type)
Invoked when the collection view type changes.
Declaration
protected virtual void OnCollectionViewTypeChanged(Type oldCollectionViewType, Type newCollectionViewType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | oldCollectionViewType | The old collection view type. |
System.Type | newCollectionViewType | The new collection view type. |
OnSourceChanged(Object, Object)
Invoked when the Source property changes.
Declaration
protected virtual void OnSourceChanged(object oldSource, object newSource)
Parameters
Type | Name | Description |
---|---|---|
System.Object | oldSource | The old value of the Source property. |
System.Object | newSource | The new value of the Source property. |
Events
| Improve this Doc View SourceFilter
Provides filtering logic.
Declaration
public event FilterEventHandler Filter
Event Type
Type | Description |
---|---|
FilterEventHandler |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | When adding a handler to this event, the View property value has a CanFilter property value of false. |
Explicit Interface Implementations
| Improve this Doc View SourceISupportInitialize.BeginInit()
Signals the object that initialization is starting.
Declaration
void ISupportInitialize.BeginInit()
ISupportInitialize.EndInit()
Signals the object that initialization is complete.
Declaration
void ISupportInitialize.EndInit()