public override void Draw(Canvas canvas) { System.Windows.Shapes.Line line = new System.Windows.Shapes.Line(); line.X1 = firstPoint.X; line.Y1 = firstPoint.Y; line.X2 = secondPoint.X; line.Y2 = secondPoint.Y; line.Stroke = Brushes.Black; line.StrokeThickness = thickness; hash = line.GetHashCode(); canvas.Children.Add(line); height = (int)Math.Abs(firstPoint.Y - secondPoint.Y); width = (int)Math.Abs(firstPoint.X - secondPoint.X); }
public override void Draw(Canvas canvas) { var line = new System.Windows.Shapes.Line() { X1 = FirstPoint.X, Y1 = FirstPoint.Y, X2 = SecondPoint.X, Y2 = SecondPoint.Y, Stroke = Color, StrokeThickness = Thickness, }; Tag = line.GetHashCode(); line.Tag = Tag; canvas.Children.Add(line); }