public static async Task <TestDisplayData> CreateAsync(SvgTest test) { var data = new TestDisplayData(test); var device = CanvasDevice.GetSharedDevice(false); data.ReferencePng = await DownloadPng(device, new Uri(test.ReferencePngUri)); var svgFile = await CachedData.GetStorageFileAsync(new Uri(test.SvgUri)); var svgDocument = await XmlDocument.LoadFromFileAsync(svgFile, new XmlLoadSettings() { ProhibitDtd = false }); data.Drawing = await SvgDrawing.LoadAsync(device, svgDocument); var description = svgDocument.SelectSingleNodeNS("//d:testDescription", "xmlns:d='http://www.w3.org/2000/02/svg/testsuite/description/'"); if (description != null) { data.Description = description.InnerText; } return(data); }
async Task LoadDrawing(ICanvasResourceCreator resourceCreator) { var svgDocument = await XmlDocument.LoadFromFileAsync(wantedSvgFile, new XmlLoadSettings() { ProhibitDtd = false }); svgDrawing = await SvgDrawing.LoadAsync(resourceCreator, svgDocument); loadedSvgFile = wantedSvgFile; canvas.Invalidate(); }