Table of Contents

Method IndexOf

Namespace
Alternet.UI
Assembly
Alternet.UI.dll

IndexOf(object)

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

public override int IndexOf(object item)

Parameters

item object

data item

Returns

int

Remarks

If this method returns an index other than -1, it must always be true that view[index-1] < item <= view[index], where the comparisons are done via the view's IComparer.Compare method (if any). (This method is used by a listener's (e.g. System.Windows.Controls.ItemsControl) CollectionChanged event handler to speed up its reaction to insertion and deletion of items. If IndexOf is not implemented, a listener does a binary search using IComparer.Compare.)