LineSegment LineSegment LineSegment Class

Definition

Represents a line drawn between two points, which can be part of a PathFigure within Path data.

public sealed class LineSegment : PathSegment, ILineSegmentpublic sealed class LineSegment : PathSegment, ILineSegmentPublic NotInheritable Class LineSegment Inherits PathSegment Implements ILineSegment
<LineSegment .../>
Inheritance
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Inherited Members

Inherited methods

Inherited properties

Remarks

Examples

This example creates a simple PathGeometry made up of a single PathFigure with a LineSegment and displays it using a Path element. The PathFigure object's StartPoint is set to (10,20) and a LineSegment is defined with an end point of (100,130).

<Canvas>
    <Path Stroke="Black" StrokeThickness="4">
        <Path.Data>
            <PathGeometry>
                <PathGeometry.Figures>
                    <PathFigure StartPoint="10,20">
                        <PathFigure.Segments>
                            <LineSegment Point="100,130"/>
                        </PathFigure.Segments>
                    </PathFigure>
                </PathGeometry.Figures>
            </PathGeometry>
        </Path.Data>
    </Path>
</Canvas>

Constructors

LineSegment() LineSegment() LineSegment()

Initializes a new instance of the LineSegment class.

public LineSegment()public LineSegment()Public Sub New()
Attributes

Properties

Point Point Point

Gets or sets the end point of the line segment.

public Point Point { get; set; }public Point Point { get; set; }Public ReadWrite Property Point As Point
<LineSegment Point="x,y"/>
Value
Point Point Point

The end point of the line segment. The default is a Point with value 0,0.

Attributes

PointProperty PointProperty PointProperty

Identifies the Point dependency property.

public static DependencyProperty PointProperty { get; }public static DependencyProperty PointProperty { get; }Public Static ReadOnly Property PointProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the Point dependency property.

Attributes

See Also