Share via


Polyline Object

Draws a series of connected straight lines.

XAML
<Polyline .../>
Scripting
To create an object using scripting, see CreateFromXAML.

Properties

Canvas.Left, Canvas.Top, Canvas.ZIndex, Clip, Cursor, Fill, FillRule, Height, Name, Opacity, OpacityMask, Points, RenderTransform, RenderTransformOrigin, Resources, Stretch, Stroke, StrokeDashArray, StrokeDashCap, StrokeDashOffset, StrokeEndLineCap, StrokeLineJoin, StrokeMiterLimit, StrokeStartLineCap, StrokeThickness, Tag, Triggers, Width

Methods

AddEventListener, CaptureMouse, Equals, FindName, GetHost, GetParent, GetValue, ReleaseMouseCapture, RemoveEventListener, SetValue

Events

Loaded, MouseEnter, MouseLeave, MouseLeftButtonDown, MouseLeftButtonUp, MouseMove

Remarks

This object is similar to the Polygon object, except that this object does not need to be a closed shape. You could achieve the same visual result by overlapping multiple Line objects.

A Polyline with only one point will not render.

Examples

The following example shows how to use a PolyLine to create a closed triangle.

XAML
<Canvas 
  xmlns="https://schemas.microsoft.com/client/2007" 
  xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml">  
                   
  <Polyline Points="50,25 0,100 100,100 50,25"
    Stroke="Blue" StrokeThickness="10"
    Canvas.Left="75" Canvas.Top="50" />
</Canvas>

See Also

Shapes Overview
Shape