ContainerVisual::VisualChildrenCount Property

 

Gets the number of children for the ContainerVisual.

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

protected:
property int VisualChildrenCount {
	virtual int get() override sealed;
}

Property Value

Type: System::Int32

The number of children in the VisualCollection of the ContainerVisual.

By default, a ContainerVisual does not have any children.

Notes to Inheritors:

Classes that derive from ContainerVisual must implement the VisualChildrenCount property to enumerate the visual children. The derived property must return the number of children for the ContainerVisual.

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
Show: