ItemContainerGenerator.IndexFromContainer ItemContainerGenerator.IndexFromContainer ItemContainerGenerator.IndexFromContainer ItemContainerGenerator.IndexFromContainer Method

Definition

Returns the index to an item that corresponds to the specified, generated UIElement.

Overloads

IndexFromContainer(DependencyObject) IndexFromContainer(DependencyObject) IndexFromContainer(DependencyObject) IndexFromContainer(DependencyObject)

Returns the index to an item that corresponds to the specified, generated UIElement.

IndexFromContainer(DependencyObject, Boolean) IndexFromContainer(DependencyObject, Boolean) IndexFromContainer(DependencyObject, Boolean) IndexFromContainer(DependencyObject, Boolean)

Returns the index to an item that corresponds to the specified, generated UIElement, optionally recursively searching hierarchical items.

IndexFromContainer(DependencyObject) IndexFromContainer(DependencyObject) IndexFromContainer(DependencyObject) IndexFromContainer(DependencyObject)

Returns the index to an item that corresponds to the specified, generated UIElement.

public:
 int IndexFromContainer(System::Windows::DependencyObject ^ container);
public int IndexFromContainer (System.Windows.DependencyObject container);
member this.IndexFromContainer : System.Windows.DependencyObject -> int
Public Function IndexFromContainer (container As DependencyObject) As Integer

Parameters

container
DependencyObject DependencyObject DependencyObject DependencyObject

The DependencyObject that corresponds to the item to the index to be returned.

Returns

An Int32 index to an item that corresponds to the specified, generated UIElement or -1 if container is not found.

Exceptions

Remarks

Calling this method is identical to calling the ItemContainerGenerator.IndexFromContainer(DependencyObject, Boolean) method and passing false to the returnLocalIndex parameter.

IndexFromContainer(DependencyObject, Boolean) IndexFromContainer(DependencyObject, Boolean) IndexFromContainer(DependencyObject, Boolean) IndexFromContainer(DependencyObject, Boolean)

Returns the index to an item that corresponds to the specified, generated UIElement, optionally recursively searching hierarchical items.

public:
 int IndexFromContainer(System::Windows::DependencyObject ^ container, bool returnLocalIndex);
public int IndexFromContainer (System.Windows.DependencyObject container, bool returnLocalIndex);
member this.IndexFromContainer : System.Windows.DependencyObject * bool -> int
Public Function IndexFromContainer (container As DependencyObject, returnLocalIndex As Boolean) As Integer

Parameters

container
DependencyObject DependencyObject DependencyObject DependencyObject

The DependencyObject that corresponds to the item to the index to be returned.

returnLocalIndex
Boolean Boolean Boolean Boolean

true to search the current level of hierarchical items; false to recursively search hierarchical items.

Returns

An Int32 index to an item that corresponds to the specified, generated UIElement or -1 if container is not found.

Applies to