Export (0) Print
Expand All

PathGeometry.Figures Property

Gets or sets the collection of PathFigure objects that describe the path's contents.

Namespace:  System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

public PathFigureCollection Figures { get; set; }
<object>
  <object.Figures>
    oneOrMoreFigures
  </object.Figures>
</object>
<object Figures="moveAndDrawCommands"/>

XAML Values

moveAndDrawCommands

One or more move and draw commands. See Path Markup Syntax.

oneOrMoreFigures

System.Windows.Media.PathFigure

One or more PathFigure objects.

Property Value

Type: System.Windows.Media.PathFigureCollection
A collection of PathFigure objects that describe the path's contents. Each individual PathFigure describes a shape.

Identifier field

FiguresProperty

Metadata properties set to true

None

This example shows how to create multiple subpaths in a PathGeometry. To create multiple subpaths, you create a PathFigure for each subpath.

The following example creates two subpaths, each one a triangle.

<Path Stroke="Black" StrokeThickness="1">
  <Path.Data>
    <PathGeometry>
      <PathGeometry.Figures>
        <PathFigureCollection>
          <PathFigure IsClosed="True" StartPoint="10,100">
            <PathFigure.Segments>
              <PathSegmentCollection>
                <LineSegment Point="100,100" />
                <LineSegment Point="100,50" />
              </PathSegmentCollection>
            </PathFigure.Segments>
          </PathFigure>
          <PathFigure IsClosed="True" StartPoint="10,10">
            <PathFigure.Segments>
              <PathSegmentCollection>
                <LineSegment Point="100,10" />
                <LineSegment Point="100,40" />
              </PathSegmentCollection>
            </PathFigure.Segments>
          </PathFigure>                    
        </PathFigureCollection>
      </PathGeometry.Figures>
    </PathGeometry>
  </Path.Data>
</Path>

The following example shows how to create multiple subpaths by using a Path and XAML attribute syntax. Each M creates a new subpath so that the example creates two subpaths that each draw a triangle.

<Path Stroke="Black" StrokeThickness="1" 
  Data="M 10,100 L 100,100 100,50 Z M 10,10 100,10 100,40 Z" />

(Note that this attribute syntax actually creates a StreamGeometry, a lighter-weight version of a PathGeometry. For more information, see the Path Markup Syntax page.)

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft