O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Line

Line defines four double properties to represent a line segment connecting points (x1,y1) and (x2,y2). These properties are called X1, Y1, X2, and Y2. These are defined as four separate properties rather than two Point properties for ease of use in data-binding scenarios.

The values of Line’s properties are not absolute coordinates. They are relative to the space given to the Line element by the layout system. For example, the following StackPanel contains three Lines, rendered in Figure 7.2:

<StackPanel>  <Line X1="0" Y1="0"   X2="100" Y2="100" Stroke="Black" StrokeThickness="10"    Margin="4"/>  <Line X1="0" Y1="0"   X2="100" Y2="0"   Stroke="Black" StrokeThickness="10"    Margin="4"/>  <Line X1="0" Y1="

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required