Share via


GeometryCollection

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Represents a collection of Geometry objects.

<GeometryCollection   ...>
  oneOrMoreGeometries
</GeometryCollection>

XAML Values

Value

Description

oneOrMoreGeometries

One or more object elements that derive from Geometry. These can be any combination of EllipseGeometry, GeometryGroup, LineGeometry, PathGeometry, and RectangleGeometry.

Managed Equivalent

GeometryCollection

Remarks

GeometryCollection defines no methods or properties beyond the basic Collection methods and properties. Methods such as Add or GetItem will expect or return objects that are of type Geometry. Geometry itself is an abstract object, so the returned objects might be any of the Geometry defined types.

For more information on basic concepts, see Geometries. Note that the Geometries topic is written primarily for users of the managed API, and may not have code examples or specific information that address the JavaScript API scenarios.

The XAML syntax for properties that use a GeometryCollection is an example of implicit collection syntax, in which you can omit an actual GeometryCollection object element. Explicitly including a GeometryCollection object element is permissible XAML syntax and might be useful if you intend to name the collection in XAML and manipulate its contents through script later.

A GeometryCollection is not itself a composite geometry, but it is used by the GeometryGroup to store Geometry objects that define a composite geometry.