Table of Contents

Class SvgIconBase

Namespace
SVGImage.SVG
Assembly
DotNetProjects.SVGImage.dll

This is an abstract implementation of a markup extension that enables the creation of DrawingImage from SVG sources.

public abstract class SvgIconBase : MarkupExtension
Inheritance
SvgIconBase
Derived
Inherited Members

Constructors

SvgIconBase()

Initializes a new instance of the SvgIconBase class with the default parameters.

protected SvgIconBase()

Fields

_appName

protected string _appName

Field Value

string

_culture

protected CultureInfo _culture

Field Value

CultureInfo

Properties

AppName

Gets or sets the project or application name of the target assembly.

public string AppName { get; set; }

Property Value

string

A string specifying the application project name.

Remarks

This is optional and is only used to resolve the resource Uri at the design time.

CultureInfo

Gets or sets the main culture information used for rendering texts.

public CultureInfo CultureInfo { get; set; }

Property Value

CultureInfo

An instance of the CultureInfo specifying the main culture information for texts. The default is the English culture.

Remarks

This is the culture information passed to the FormattedText class instance for the text rendering.

The library does not currently provide any means of splitting texts into its multi-language parts.

OverrideColor

public Color? OverrideColor { get; set; }

Property Value

Color?

OverrideFillColor

public Color? OverrideFillColor { get; set; }

Property Value

Color?

OverrideStrokeColor

public Color? OverrideStrokeColor { get; set; }

Property Value

Color?

Methods

GetAppName()

protected void GetAppName()

GetDrawing(Uri)

This converts the SVG resource specified by the Uri to DrawingGroup.

protected virtual DrawingGroup GetDrawing(Uri svgSource)

Parameters

svgSource Uri

A Uri specifying the source of the SVG resource.

Returns

DrawingGroup

A DrawingGroup of the converted SVG resource.

GetEntryAssembly()

protected Assembly GetEntryAssembly()

Returns

Assembly

GetExecutingAssembly()

protected Assembly GetExecutingAssembly()

Returns

Assembly

GetImage(Uri)

This converts the SVG resource specified by the Uri to DrawingImage.

protected virtual DrawingImage GetImage(Uri svgSource)

Parameters

svgSource Uri

A Uri specifying the source of the SVG resource.

Returns

DrawingImage

A DrawingImage of the converted SVG resource.

Remarks

This uses the GetDrawing(Uri) method to convert the SVG resource to DrawingGroup, which is then wrapped in DrawingImage.

IsDesignMode(IServiceProvider)

protected bool IsDesignMode(IServiceProvider serviceProvider = null)

Parameters

serviceProvider IServiceProvider

Returns

bool