Class SvgIconConverterExtension
This implements a markup extension that enables the creation of DrawingImage from SVG sources.
public sealed class SvgIconConverterExtension : SvgIconBase, IValueConverter
- Inheritance
-
SvgIconConverterExtension
- Implements
- Inherited Members
Remarks
The SVG source file can be:
- From the web
- From the local computer (relative or absolute paths)
- From the resources.
The rendering settings are provided as properties for customizations.
Constructors
SvgIconConverterExtension()
Initializes a new instance of the SvgIconConverterExtension class with the default parameters.
public SvgIconConverterExtension()
SvgIconConverterExtension(Uri)
public SvgIconConverterExtension(Uri baseUri)
Parameters
baseUriUri
Methods
Convert(object, Type, object, CultureInfo)
Converts a value.
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Parameters
valueobjectThe value produced by the binding source.
targetTypeTypeThe type of the binding target property.
parameterobjectThe converter parameter to use.
cultureCultureInfoThe culture to use in the converter.
Returns
ConvertBack(object, Type, object, CultureInfo)
Converts a value.
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Parameters
valueobjectThe value that is produced by the binding target.
targetTypeTypeThe type to convert to.
parameterobjectThe converter parameter to use.
cultureCultureInfoThe culture to use in the converter.
Returns
ProvideValue(IServiceProvider)
Performs the conversion of a valid SVG source file to the DrawingImage that is set as the value of the target property for this markup extension.
public override object ProvideValue(IServiceProvider serviceProvider)
Parameters
serviceProviderIServiceProviderObject that can provide services for the markup extension.
Returns
- object
This returns DrawingImage if successful; otherwise, it returns null.