System.Windows.Media Namesp ...


.NET Framework Class Library for Silverlight
Geometry Class

Provides a base class for objects that define geometric shapes. Geometry objects can be used for clipping regions and as geometry definitions for rendering two-dimensional graphic data as a Path.

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

Visual Basic (Declaration)
Public MustInherit Class Geometry _
    Inherits DependencyObject
Visual Basic (Usage)
Dim instance As Geometry
C#
public abstract class Geometry : DependencyObject
Remarks

For XAML syntaxes that take a Geometry, you need to specify a nonabstract derived type of Geometry as an object element. For details, see the XAML syntax on the reference pages for EllipseGeometry, GeometryGroup, LineGeometry, PathGeometry, or RectangleGeometry.

Geometries can be conceptualized as being "simple" or "complex" geometries. EllipseGeometry, LineGeometry, and RectangleGeometry are the simple geometries, which specify the geometrical shape as one element with basic coordinate or dimension properties. GeometryGroup and PathGeometry are the complex geometries. GeometryGroup combines other geometries that it holds as child objects. PathGeometry uses either a set of nested figure/segment path definition elements or a compact string syntax to describe a path for the geometry. For more information, see Geometries or Path Markup Syntax.

A Geometry does not entirely define its own rendering. Instead, a Geometry is provided as data for a Path. Path in turn is a UIElement and therefore participates in the Silverlight 2 rendering system.

Geometry Compared to Shape

The System.Windows.Shapes..::.Shape class has a Fill, Stroke, and other rendering properties that Geometry and its derived classes lack. The Shape class is a FrameworkElement and therefore participates in the layout system; its derived classes can be used as the content of any element that supports UIElement children.

The Geometry class, on the other hand, simply defines the geometry of a shape, and cannot render itself. Because of its simplicity, it has a wider range of uses.

Inheritance Hierarchy

System..::.Object
  System.Windows..::.DependencyObject
    System.Windows.Media..::.Geometry
      System.Windows.Media..::.EllipseGeometry
      System.Windows.Media..::.GeometryGroup
      System.Windows.Media..::.LineGeometry
      System.Windows.Media..::.PathGeometry
      System.Windows.Media..::.RectangleGeometry
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also

Reference

Other Resources

Tags :


Page view tracker