GeometryCollection Object

Represents a collection of Geometry objects.

<GeometryCollection ...>
To create an object using scripting, see CreateFromXAML.

XAML Values

oneOrMoreGeometries One or more object elements that derive from Geometry. These can be one or more of the following: EllipseGeometry, GeometryGroup, LineGeometry, PathGeometry, RectangleGeometry.


Count, Name


Add, Equals, FindName, GetHost, GetItem, GetValue, Insert, Remove, RemoveAt, SetValue


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 class, so the items might be any of the Geometry defined types (for details, see Geometry or Silverlight Geometries Overview).

The XAML syntax for properties that use a GeometryCollection is an example of an implicit collection syntax, where you can omit an actual GeometryCollection object element. Instead, you generally include one or more geometry-type object elements as child elements of a GeometryGroup. For more information about XAML implicit collection syntax, see XAML Syntax Overview. (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 is used by the GeometryGroup class to store Geometry objects that define a composite geometry.

See Also

Geometry Overview