ContainerVisual.GetVisualChild Method (Int32)


Returns a specified child Visual for the parent ContainerVisual.

Namespace:   System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)

override GetVisualChild : 
        index:int -> Visual


Type: System.Int32

A 32-bit signed integer that represents the index value of the child Visual. The value of index must be between 0 and VisualChildrenCount - 1.

Return Value

Type: System.Windows.Media.Visual

The child Visual.

By default, a ContainerVisual does not have any children.

Notes to Inheritors:

The visual tree cannot be modified during this call.

The following example shows how to create a ContainerVisual object that is used as the parent for two DrawingVisual objects. Objects that are added to the ContainerVisual object must be added in reverse z-order (bottom to top) to ensure they are rendering in the correct drawing order. In order for the visual tree to be enumerated correctly, the example provides overridden implementations of the GetVisualChild method and VisualChildrenCount property.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top