LineGeometry.EndPoint Property

Gets or sets the end point of a line. This is a dependency property.

Namespace:  System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

public Point EndPoint { get; set; }
<object>
  <object.EndPoint>
    <Point .../>
  </object.EndPoint>
</object>
<object EndPoint="Point" .../>

Property Value

Type: System.Windows.Point
The end point of the line. The default is (0,0).

Identifier field

EndPointProperty

Metadata properties set to true

None

This example shows how to use the LineGeometry class to describe a line. A LineGeometry is defined by its start and end points.

The following example shows how to create and render a LineGeometry. A Path element is used to render the line. Since a line has no area, the Path object's Fill is not specified; instead the Stroke and StrokeThickness properties are used.

<Path Stroke="Black" StrokeThickness="1" >
  <Path.Data>
    <LineGeometry StartPoint="10,20" EndPoint="100,130" />
  </Path.Data>
</Path>
LineGeometry myLineGeometry = new LineGeometry();
myLineGeometry.StartPoint = new Point(10,20);
myLineGeometry.EndPoint = new Point(100,130);

Path myPath = new Path();
myPath.Stroke = Brushes.Black;
myPath.StrokeThickness = 1;
myPath.Data = myLineGeometry;
A LineGeometry drawn from (10,20) to (100,130)

A LineGeometry

Other simple geometry classes include LineGeometry and EllipseGeometry. These geometries, as well as more complex ones, can also be created using a PathGeometry or StreamGeometry. For more information, see the Geometry Overview.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft