Table of Contents

Class SvgIconConverterExtension

Namespace
SVGImage.SVG
Assembly
DotNetProjects.SVGImage.dll

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

baseUri Uri

Methods

Convert(object, Type, object, CultureInfo)

Converts a value.

public object Convert(object value, Type targetType, object parameter, CultureInfo culture)

Parameters

value object

The value produced by the binding source.

targetType Type

The type of the binding target property.

parameter object

The converter parameter to use.

culture CultureInfo

The culture to use in the converter.

Returns

object

A converted value. If the method returns null, the valid null value is used.

ConvertBack(object, Type, object, CultureInfo)

Converts a value.

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)

Parameters

value object

The value that is produced by the binding target.

targetType Type

The type to convert to.

parameter object

The converter parameter to use.

culture CultureInfo

The culture to use in the converter.

Returns

object

A converted value. If the method returns null, the valid null value is used.

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

serviceProvider IServiceProvider

Object that can provide services for the markup extension.

Returns

object

This returns DrawingImage if successful; otherwise, it returns null.