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 Line
s, 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="
Get XAML Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.