XAML Polyline

The <Polyline/> element of XAML is used to draw connected lines. This article shows how to use the PolyLine element to draw lines in XAML.
  • 3291

The <Polyline /> element of XAML draws a ployline, which is a series of connected lines. Unlike a polygon, which is a closed curver, a polyline is usually an open curve. If you want to draw a series of connected lines but closed curve, you might want to use polygon.

Similar to the polygon, a polyline has Points attribute that defines the points of lines draw from and to. The following code draws a ployline.

<Polyline Points="50,100 150,100 100,50 250,50" Stroke="Blue" StrokeThickness="2"/>

The output looks like Figure 1.


Figure 1. Drawing a polyline

Ask Your Question 
Got a programming related question? You may want to post your question here
© 2020 DotNetHeaven. All rights reserved.