Has anyone got some fool-proof settings for exporting SVG files from illustrator for WPF environment dev buttons?

Specifically, I'm being told by the developers the icons with a gradient are creating a URL reference within the doc, the syntax appears correct but it won't read the URL gradient reference or ignores it.

3 Answers 3


Short answer: You'll want convert svg to xaml files.

SVGs always reference a gradient by url. Even though its internal . Unlike CSS where you can specify a linear gradient as a property. SVGs reference an ID to an internal gradient fill="url(#Gradient)". You can't get around this.

<?xml version="1.0" standalone="no"?>
<svg width="120" height="120" version="1.1"
      <radialGradient id="Gradient"
            cx="0.5" cy="0.5" r="0.5" fx="0.25" fy="0.25">
        <stop offset="0%" stop-color="red"/>
        <stop offset="100%" stop-color="blue"/>
  <rect x="10" y="10" rx="15" ry="15" width="100" height="100"
        fill="url(#Gradient)" />
  <circle cx="60" cy="60" r="50" fill="transparent" />

.NET doesn't support SVGs very well (.NET being the Windows language used in WFP). There is a tool sharpvectors which should aid in making an SVG compatible in in .NET/WFP applications. Converting SVG into Windows custom format XAML.

It should also provide a GUI to view the graphic in a Windows/WFP environment. Offering some assurance that'll work before handing it to a Dev.


If it can't handle URL gradients, then don't use a gradient. Perhaps use a raster image of a gradient instead, or even a step blend, and contain it within a clipping mask.

I don't know how practical this will be but at least it won't use a URL gradient. Maybe ask your developer.


Maybe you want to give the ShapeConverter a try. It handles gradients well. Just download the latest executable from the releases and run it: https://github.com/gomi42/ShapeConverter. The ShapeConverter converts Illustrator, Photoshop, EPS and SVG to XAML and gives you quite a lot of options about the output format.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.