private void Draw(MouseEventArgs e) { SolidColorBrush brush = new(Services.brushColor); Line line = new() { Stroke = brush, StrokeThickness = Services.brushSize, StrokeEndLineCap = PenLineCap.Round, StrokeStartLineCap = PenLineCap.Round, X1 = currentPoint.X, Y1 = currentPoint.Y, X2 = e.GetPosition(this).X, Y2 = e.GetPosition(this).Y }; points.Add(new Point(e.GetPosition(this).X, e.GetPosition(this).Y)); currentPoint = e.GetPosition(this); sketchCanvas.Children.Add(line); }