Gets the depth of nesting of specified object in the visual tree.

Namespace: FirstFloor.SilverlightSpy.Interop
Assembly: FirstFloor.SilverlightSpy.Interop (in FirstFloor.SilverlightSpy.Interop.dll) Version: 4.0.0.0 (4.0.5.0)

Syntax

C#
public static int GetDepth(
	this DependencyObject o
)
Visual Basic
<ExtensionAttribute> _
Public Shared Function GetDepth ( _
	o As DependencyObject _
) As Integer
Visual C++
public:
[ExtensionAttribute]
static int GetDepth(
	DependencyObject^ o
)

Parameters

o
Type: System.Windows..::..DependencyObject
The object.

Return Value

The depth of the object.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DependencyObject. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

Use the Depth property to determine the depth of the node. The depth represents the number of levels of hierarchy between an object and the root element. For example, a root node has a depth of zero. A child of the root node has a depth of one, and so on.

See Also