Interface ICollectionView
ICollectionView is an interface that applications writing their own collections can implement to enable current record management, sorting, filtering, grouping etc in a custom way.
public interface ICollectionView : IEnumerable, INotifyCollectionChanged
Properties
- CanFilter
Indicates whether or not this ICollectionView can do any filtering.
- CanGroup
Returns true if this view really supports grouping. When this returns false, the rest of the interface is ignored.
- CanSort
Whether or not this ICollectionView does any sorting.
- Culture
Culture contains the CultureInfo used in any operations of the ICollectionView that may differ by Culture, such as sorting.
- CurrentItem
Return current item.
- CurrentPosition
The ordinal position of the CurrentItem within the (optionally sorted and filtered) view.
- Filter
Filter is a callback set by the consumer of the ICollectionView and used by the implementation of the ICollectionView to determine if an item is suitable for inclusion in the view.
- GroupDescriptions
The description of grouping, indexed by level.
- Groups
The top-level groups, constructed according to the descriptions given in GroupDescriptions.
- IsCurrentAfterLast
Return true if CurrentItem is beyond the end (End-Of-File).
- IsCurrentBeforeFirst
Return true if CurrentItem is before the beginning (Beginning-Of-File).
- IsEmpty
Returns true if the resulting (filtered) view is emtpy.
- SortDescriptions
Collection of Sort criteria to sort items in this view over the SourceCollection.
- SourceCollection
SourceCollection is the original un-filtered collection of which this ICollectionView is a view.
Methods
- Contains(object)
Return true if the item belongs to this view. No assumptions are made about the item. This method will behave similarly to IList.Contains(). If the caller knows that the item belongs to the underlying collection, it is more efficient to call Filter.
- DeferRefresh()
Enter a Defer Cycle. Defer cycles are used to coalesce changes to the ICollectionView.
- MoveCurrentTo(object)
Move CurrentItem to the given item.
- MoveCurrentToFirst()
Move CurrentItem to the first item.
- MoveCurrentToLast()
Move CurrentItem to the last item.
- MoveCurrentToNext()
Move CurrentItem to the next item.
- MoveCurrentToPosition(int)
Move CurrentItem to the item at the given index.
- MoveCurrentToPrevious()
Move CurrentItem to the previous item.
- Refresh()
Re-create the view, using any SortDescriptions.
Events
- CurrentChanged
Raise this event after changing to a new current item.
- CurrentChanging
Raise this event before change of current item pointer. Handlers can cancel the change.