Set Line Along Canvas Top and Left
<Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="WPF" Height="250" Width="500"> <StackPanel Orientation="Horizontal"> <Canvas Margin="5"> <TextBlock FontSize="14" Text="Lines in a Canvas:"/> <Line Canvas.Top="100" Canvas.Left="20" X2="200" Y2="40" Stroke="Black" StrokeThickness="5"/> <Line Canvas.Bottom="30" Canvas.Left="180" X1="0" Y1="30" X2="-10" Y2="-130" Stroke="Black" StrokeThickness="5"/> </Canvas> </StackPanel> </Window>