Polyline.Points Property

July 28, 2014

Gets or sets a collection that contains the vertex points of the Polyline.

Namespace:  System.Windows.Shapes
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

'Declaration
Public Property Points As PointCollection
<Polyline Points="pointSet"/>

XAML Values

pointSet

See "pointSet Grammar" in Remarks.

Property Value

Type: System.Windows.Media.PointCollection
A collection of Point structures that describe the vertex points of the Polyline. The default is Nothing.

Dependency property identifier field: PointsProperty

A single point, such as (0,0), is a valid value, but will not render anything because you need a minimum of two points to produce a rendered output.

pointSet Grammar

A valid pointSet for the Points property describes one or more points. As an example of the point set grammar, the string "0,0 50,100 100,0" would produce a "V" shaped polyline with its acute angle placed at 50,100.

X,Y[ X*,Y*]*

X, Y

A pair of double values that identify the x,y initial point of the polyline.

X*,Y*

Subsequent pairs of double values that define additional points of this polyline.

  • The [] characters are not literals; they are indicators of unbounded values. The * also is not literal and indicates that any number of points is permitted past the initial X,Y.

  • The separator in this grammar can be either a space or a comma. You can use a mixture of space and comma as separators. The common convention is to use commas between the X and Y, and spaces between the points.

  • Any odd number of double values in a Points value / set of points is not allowed and will throw either a parser or runtime error. The number of double values in the string must always be even so that it evaluates as x,y pairs of points.

  • The pointSet grammar behavior is implemented by a dedicated native-XAML type converter for PointCollection.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft