Table of Contents

Class ListCollectionView

Namespace
Alternet.UI
Assembly
Alternet.UI.dll

ICollectionView based on and associated to IList.

public class ListCollectionView : CollectionView, IBaseObject, IDisposableObject, IDisposable, ICollectionView, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged, IComparer, IEditableCollectionViewAddNewItem, IEditableCollectionView, ICollectionViewLiveShaping, IItemProperties
Inheritance
ListCollectionView
Implements

Constructors

ListCollectionView(IList)

Constructor

Properties

ActiveComparer

Protected accessor to private _activeComparer field.

ActiveFilter

Protected accessor to private _activeFilter field.

CanAddNew

Return true if the view supports AddNew().

CanAddNewItem

Return true if the view supports AddNewItem(object).

CanCancelEdit

Returns true if the view supports the notion of "pending changes" on the current edit item. This may vary, depending on the view and the particular item. For example, a view might return true if the current edit item implements IEditableObject, or if the view has special knowledge about the item that it can use to support rollback of pending changes.

CanChangeLiveFiltering

Gets a value that indicates whether this view supports turning live filtering on or off.

CanChangeLiveGrouping

Gets a value that indicates whether this view supports turning live grouping on or off.

CanChangeLiveSorting

Gets a value that indicates whether this view supports turning live sorting on or off.

CanFilter

Test if this ICollectionView supports filtering before assigning a filter callback to Filter.

CanGroup

Returns true if this view really supports grouping. When this returns false, the rest of the interface is ignored.

CanRemove

Return true if the view supports Remove(object) and RemoveAt(int).

CanSort

Test if this ICollectionView supports sorting before adding to SortDescriptions.

Count

Return the estimated number of records (or -1, meaning "don't know").

CurrentAddItem

When an AddNew() transaction is in progress, this property returns the new item. Otherwise it returns null.

CurrentEditItem

When an EditItem(object) transaction is in progress, this property returns the affected item. Otherwise it returns null.

CustomSort

Set a custom comparer to sort items using an object that implements IComparer.

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.

GroupBySelector

A delegate to select the group description as a function of the parent group and its level.

GroupDescriptions

The description of grouping, indexed by level.

Groups

The top-level groups, constructed according to the descriptions given in GroupDescriptions and/or GroupBySelector.

InternalCount

Protected accessor to private count.

InternalList

Protected accessor to private _internalList field.

IsAddingNew

Returns true if an AddNew() transaction is in progress.

IsDataInGroupOrder

Setting this to true informs the view that the list of items (after applying the sort and filter, if any) is already in the correct order for grouping. This allows the view to use a more efficient algorithm to build the groups.

IsEditingItem

Returns true if an EditItem(object) transaction is in progress.

IsEmpty

Returns true if the resulting (filtered) view is emtpy.

IsGrouping

Protected accessor to _isGrouping field.

IsLiveFiltering

Gets or sets a value that indicates whether live filtering is enabled. The value may be null if the view does not know whether live filtering is enabled. Calling the setter when CanChangeLiveFiltering is false will throw an InvalidOperationException.

IsLiveGrouping

Gets or sets a value that indicates whether live grouping is enabled. The value may be null if the view does not know whether live grouping is enabled. Calling the setter when CanChangeLiveGrouping is false will throw an InvalidOperationException.

IsLiveSorting

Gets or sets a value that indicates whether live sorting is enabled. The value may be null if the view does not know whether live sorting is enabled. Calling the setter when CanChangeLiveSorting is false will throw an InvalidOperationException.

ItemProperties

Returns information about the properties available on items in the underlying collection. This information may come from a schema, from a type descriptor, from a representative item, or from some other source known to the view.

LiveFilteringProperties

Gets a collection of strings describing the properties that trigger a live-filtering recalculation. The strings use the same format as SortDescription.PropertyName.

LiveGroupingProperties

Gets a collection of strings describing the properties that trigger a live-grouping recalculation. The strings use the same format as PropertyGroupDescription.PropertyName.

LiveSortingProperties

Gets a collection of strings describing the properties that trigger a live-sorting recalculation. The strings use the same format as SortDescription.PropertyName.

NewItemPlaceholderPosition

Indicates whether to include a placeholder for a new item, and if so, where to put it.

SortDescriptions

Collection of Sort criteria to sort items in this view over the SourceCollection.

UsesLocalArray

True if a private copy of the data is needed for sorting and filtering

Methods

AddNew()

Add a new item to the underlying collection. Returns the new item. After calling AddNew and changing the new item as desired, either CommitNew() or CancelNew() should be called to complete the transaction.

AddNewItem(object)

Add a new item to the underlying collection. Returns the new item. After calling AddNewItem and changing the new item as desired, either CommitNew() or CancelNew() should be called to complete the transaction.

CancelEdit()

Complete the transaction started by EditItem(object). The pending changes (if any) to the item are discarded.

CancelNew()

Complete the transaction started by AddNew(). The new item is removed from the collection.

CommitEdit()

Complete the transaction started by EditItem(object). The pending changes (if any) to the item are committed.

CommitNew()

Complete the transaction started by AddNew(). The new item remains in the collection, and the view's sort, filter, and grouping specifications (if any) are applied to the new item.

Compare(object, object)

Return -, 0, or +, according to whether o1 occurs before, at, or after o2 (respectively)

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() and will do an exhaustive search through all items in this view. If the caller knows that the item belongs to the underlying collection, it is more efficient to call PassesFilter.

EditItem(object)

Begins an editing transaction on the given item. The transaction is completed by calling either CommitEdit() or CancelEdit(). Any changes made to the item during the transaction are considered "pending", provided that the view supports the notion of "pending changes" for the given item.

GetEnumerator()

Implementation of IEnumerable.GetEnumerator(). This provides a way to enumerate the members of the collection without changing the currency.

GetItemAt(int)

Retrieve item at the given zero-based index in this CollectionView.

IndexOf(object)

Return the index where the given item belongs, or -1 if this index is unknown.

InternalContains(object)

Return true if internal list contains the item.

InternalGetEnumerator()

Return an enumerator for the internal list.

InternalIndexOf(object)

Return index of item in the internal list.

InternalItemAt(int)

Return item at the given index in the internal list.

MoveCurrentToPosition(int)

Move CurrentItem to the item at the given index.

OnAllowsCrossThreadChangesChanged()

Occurs when the AllowsCrossThreadChanges property changes.

OnBeginChangeLogging(NotifyCollectionChangedEventArgs)

Obsolete. Retained for compatibility. Use OnAllowsCrossThreadChangesChanged instead.

PassesFilter(object)

Return true if the item belongs to this view. The item is assumed to belong to the underlying DataCollection; this method merely takes filters into account. It is commonly used during collection-changed notifications to determine if the added/removed item requires processing. Returns true if no filter is set on collection view.

ProcessCollectionChanged(NotifyCollectionChangedEventArgs)

Handle CollectionChange events

RefreshOverride()

Re-create the view over the associated IList

Remove(object)

Remove the given item from the underlying collection.

RemoveAt(int)

Remove the item at the given index from the underlying collection. The index is interpreted with respect to the view (not with respect to the underlying collection).