'Move a SVG icon along a Path in Xamarin.Forms

Is there a best practice on how to animate and move a SVG icon along a path of (x/y) coordinates in Xamarin.Forms?

With Xamarin.Forms.Shapes there is the Path class. I could draw some path in an Editor like Figma, copy-paste the path in a Xaml Path instance like David Ortinau shows it.

But how to move a SVG icon from the begin to the end of such path?

enter image description here



Solution 1:[1]

As far as I found out until now, there is not best practice for this topic. With Xamarin.Forms Shapes and Path it can be done by traversing the Path.Data which is a Geometry instance and extract the (x,y) coords point by point. Afterwards all the extracted points can be used to call TranslateTo(x,y) point by point on e.g. a BoxView to move along a path.

With SkiaSharp this sample sounds reasonable.

https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/graphics/skiasharp/curves/information#traversing-the-path

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Erich Brunner