Hello,
Welcome to our Microsoft Q&A platform!
SVG is a XML format, you can iterate through a SVG file the same as with any XML file. I define a circle SVG and iterate it with XML file like following code:
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<circle cx="100" cy="50" r="40" stroke="black"
stroke-width="2" fill="red" />
</svg>
var assembly = GetType().GetTypeInfo().Assembly;
Stream stream = assembly.GetManifestResourceStream("XMLFile.xml");
XmlDocument xml = new XmlDocument();
xml.Load(stream);
var circle = xml.GetElementsByTagName("circle").Item(0).InnerText;
Also, if you want to click and do something, using HybridWebView might be a good option, any click events generated from the SVG will be Javascript events and would need to be handled in Javascript code on the web page side. Maybe invoking C# from JavaScript will be used, this requires you know about Javascript .
For more informaton , you can refer:
https://stackoverflow.com/questions/44332451/how-can-i-parse-xml-file-type-of-svg
https://stackoverflow.com/questions/35844589/how-to-change-svgs-path-color/35846034
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/hybridwebview
Best Regards,
Wenyan Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.