Line line = new Line
{
Stroke = Brushes.Blue,
Stroke = Brushes.Blue,
StrokeThickness = 18,
StrokeStartLineCap = PenLineCap.Round,
StrokeEndLineCap = PenLineCap.Round,
Height= 50,
X1 = 50,
X2 = 100,
Y1 = 10,
Y2 = 10
};
canvas.Children.Add(line);