Method IndexOf
IndexOf(object)
Return the index where the given item belongs, or -1 if this index is unknown.
public virtual int IndexOf(object item)
Parameters
item
objectdata item
Returns
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.)