Polyline.Points Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

Namespace:   System.Windows.Shapes
Assembly:  PresentationFramework (in PresentationFramework.dll)

public PointCollection Points { get; set; }

Property Value

Type: System.Windows.Media.PointCollection

A collection of Point structures that describe the vertex points of the Polyline. The default is a null reference (Nothing in Visual Basic).

In Extensible Application Markup Language (XAML), use a space-delimited list of comma-separated x- coordinate and y-coordinate pairs to set this attribute. Use simple notation, that is, x1,y1 x2,y2 ... xn,yn.

Identifier field


Metadata properties set to true

AffectsRender, AffectsMeasure

The following example shows how to create a Polyline element and set the Points property by using code.

// Add the Polyline Element
myPolyline = new Polyline();
myPolyline.Stroke = System.Windows.Media.Brushes.SlateGray;
myPolyline.StrokeThickness = 2;
myPolyline.FillRule = FillRule.EvenOdd;
System.Windows.Point Point4 = new System.Windows.Point(1, 50);
System.Windows.Point Point5 = new System.Windows.Point(10, 80);
System.Windows.Point Point6 = new System.Windows.Point(20, 40);
PointCollection myPointCollection2 = new PointCollection();
myPolyline.Points = myPointCollection2;

.NET Framework
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top