VisualTreeHelper.GetChild Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Using the provided index, obtains a specific child object of the provided object by examining the visual tree.
Assembly: System.Windows (in System.Windows.dll)
Parameters
- reference
- Type: System.Windows.DependencyObject
The object that holds the child collection.
- childIndex
- Type: System.Int32
The index of the requested child object in the reference child collection.
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | Specified an invalid child index. |
| InvalidOperationException | reference is null, or is not a valid UIElement. |
Show: