ClassRadSvgImage
Represents a control for displaying SVG images in a WPF application. The RadSvgImage class allows for the rendering of SVG files or XML strings as visual content, providing various properties for customization such as UriSource, XmlSource, ImageSource, and options to override colors and stroke widths. It supports animations and custom brushes, enabling the user to tailor the SVG image's appearance to fit specific requirements. The class integrates with the WPF rendering system, ensuring appropriate measurement and layout through dependency properties such as SizeType. Additionally, it handles loading SVG data from various sources, including local files and URI schemes, while maintaining the application’s context through the BaseUri property.
Definition
Namespace:Telerik.Windows.Controls
Assembly:Telerik.Windows.Controls.dll
Syntax:
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Svg")]
[TelerikToolboxCategory("Common")]
public class RadSvgImage : Control, IUriContext
Inheritance: objectRadSvgImage
Implements:
Constructors
RadSvgImage()
Initializes a new instance of the RadSvgImage class.
Declaration
public RadSvgImage()
Fields
CustomBrushesProperty
Identifies the CustomBrushes dependency property.
Declaration
public static readonly DependencyProperty CustomBrushesProperty
Field Value
DependencyProperty
ImageSourceProperty
Identifies the ImageSource dependency property.
Declaration
public static readonly DependencyProperty ImageSourceProperty
Field Value
DependencyProperty
OverrideColorProperty
Identifies the OverrideColor dependency property.
Declaration
public static readonly DependencyProperty OverrideColorProperty
Field Value
DependencyProperty
OverrideStrokeWidthProperty
Identifies the OverrideStrokeWidth dependency property.
Declaration
public static readonly DependencyProperty OverrideStrokeWidthProperty
Field Value
DependencyProperty
SizeTypeProperty
Identifies the SizeType dependency property.
Declaration
public static readonly DependencyProperty SizeTypeProperty
Field Value
DependencyProperty
UriSourceProperty
Identifies the UriSource dependency property.
Declaration
public static readonly DependencyProperty UriSourceProperty
Field Value
DependencyProperty
UseAnimationsProperty
Identifies the UseAnimations dependency property.
Declaration
public static readonly DependencyProperty UseAnimationsProperty
Field Value
DependencyProperty
XmlSourceProperty
Identifies the XmlSource dependency property.
Declaration
public static readonly DependencyProperty XmlSourceProperty
Field Value
DependencyProperty
Properties
BaseUri
Gets or sets the base URI of the current application context.
Declaration
public Uri BaseUri { get; set; }
Property Value
Uri
The base URI of the application context.
CustomBrushes
Gets or sets the collection of custom brushes.
Declaration
[SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public Dictionary<string, Brush> CustomBrushes { get; set; }
Property Value
Dictionary<string, Brush>
ImageSource
Gets or sets a Drawing that can be used for building the SVG image.
Declaration
public Drawing ImageSource { get; set; }
Property Value
Drawing
OverrideColor
Gets or sets a value which is used to replace the fill color of this SVG image.
Declaration
public Color? OverrideColor { get; set; }
Property Value
Color?
OverrideStrokeWidth
Gets or sets a value which is used to replace the stroke width of this SVG image.
Declaration
public double? OverrideStrokeWidth { get; set; }
Property Value
SizeType
Gets or sets the size type of the image.
UriSource
Gets or sets the path to the SVG file to load into this image instance.
Declaration
public Uri UriSource { get; set; }
Property Value
Uri
A Uri specifying the path to the SVG source file. The file can be located on a computer, network or assembly resources.
UseAnimations
Gets or sets a value indicating whether the animations are used on this SVG image instance.
Methods
ArrangeOverride(Size)
Declaration
protected override Size ArrangeOverride(Size arrangeBounds)
Parameters
arrangeBounds
Size
Returns
Size
MeasureOverride(Size)
Declaration
protected override Size MeasureOverride(Size constraint)
Parameters
constraint
Size
Returns
Size
OnCreateAutomationPeer()
Creates a RadSvgImageAutomationPeer.
Declaration
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "Reviewed.")]
protected override AutomationPeer OnCreateAutomationPeer()
Returns
AutomationPeer
OnInitialized(EventArgs)
Declaration
protected override void OnInitialized(EventArgs e)
Parameters
e
OnRender(DrawingContext)
Declaration
protected override void OnRender(DrawingContext drawingContext)
Parameters
drawingContext
DrawingContext
OnRenderSizeChanged(SizeChangedInfo)
Declaration
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
Parameters
sizeInfo
SizeChangedInfo