I was wondering, is there another way to draw lines in Xamarin.Form, aside from SkiaSharp. I want to

I was wondering, is there another way to draw lines in Xamarin.Form, aside from SkiaSharp. I want to use touch gestures to draw straight lines, and the only way I could find is to use SkiaSharp. My problem with SkiaSharp is that, while I can draw lines, I can't add other controls.
This is my code for drawing the lines
`private void OnPain(object sender, SKPaintSurfaceEventArgs e)
{
var touchPathStoke = new SKPaint
{
IsAntialias = true,
Style = SKPaintStyle.Stroke,
Color = SKColors.Brown,
StrokeWidth = 10
};

        foreach(var touchPath in temporaryPaths)
        {
            canvas.DrawPath(touchPath.Value, touchPathStoke);
        }

        foreach(var touchPath in paths)
        {
            canvas.DrawPath(touchPath, touchPathStoke);
        }
    }`

` private void OntouchTest(object sender, SKTouchEventArgs e)
{

        switch (e.ActionType)
        {
            case SKTouchAction.Pressed:
                var p = new SKPath();
                p.MoveTo(e.Location);
                temporaryPaths[e.Id] = p;
                break;
            case SKTouchAction.Moved:
                if (e.InContact)
                    temporaryPaths[e.Id].MoveTo(e.Location);
                break;
            case SKTouchAction.Released:
                paths.Add(temporaryPaths[e.Id]);
                temporaryPaths.Remove(e.Id);
                break;
            case SKTouchAction.Cancelled:
                temporaryPaths.Remove(e.Id);
                break;
        }

        e.Handled = true;

        ((SKCanvasView)sender).InvalidateSurface();
    }`

I Just want to draw the line, and add a control (for example Entry), using touch gesture.

Sign In or Register to comment.