Click or drag to resize
CanvasSvgNamedElement Class
[Win10_15063] Specifies an SVG element which can be part of an SVG document.
Inheritance Hierarchy

Namespace:  Microsoft.Graphics.Canvas.Svg
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version:
public sealed class CanvasSvgNamedElement : ICanvasSvgElement, 

The CanvasSvgNamedElement type exposes the following members.

Public propertyContainingDocument
[Win10_15063] Gets the document which contains this element.
Public propertyDevice
[Win10_15063] Gets the device associated with this SVG element.
Public propertyFirstChild
[Win10_15063] Gets this element's first child.
Public propertyHasChildren
[Win10_15063] Gets whether this element has any children.
Public propertyLastChild
[Win10_15063] Gets this element's last child.
Public propertyParent
[Win10_15063] Gets theis element's parent.
Public propertySpecifiedAttributes
[Win10_15063] Gets an array containing the set of attributes specified for this element.
Public propertyTag
[Win10_15063] Gets the name of this element.
Public methodAppendChild
[Win10_15063] Appends a child element to this element.
Public methodCreateAndAppendNamedChildElement
[Win10_15063] Creates a new named element and appends it to this element's children.
Public methodCreateAndAppendTextChildElement
[Win10_15063] Creates a new text element and appends it to this element's children.
Public methodDispose
[Win10_15063] Releases all resources used by the CanvasSvgNamedElement.
Public methodGetAspectRatioAttribute
[Win10_15063] Gets an aspect ratio attribute, retrieving both the alignment and scaling.
Public methodGetAttribute
[Win10_15063] Gets an object attribute.
Public methodGetCapStyleAttribute
[Win10_15063] Gets a cap style attribute.
Public methodGetColorAttribute
[Win10_15063] Gets a color attribute.
Public methodGetDisplayAttribute
[Win10_15063] Gets a display attribute.
Public methodGetEdgeBehaviorAttribute
[Win10_15063] Gets an edge behavior attribute.
Public methodGetFilledRegionDeterminationAttribute
[Win10_15063] Gets a filled region determination attribute.
Public methodGetFloatAttribute
[Win10_15063] Gets a float attribute.
Public methodGetIdAttribute
[Win10_15063] Gets an ID attribute.
Public methodGetLengthAttribute
[Win10_15063] Gets a length attribute, where both a value and the type of units that value is in are retrieved.
Public methodGetLineJoinAttribute
[Win10_15063] Gets a line join attribute.
Public methodGetNextSibling
[Win10_15063] Gets the next sibling of the specified element, or null if there is no next sibling.
Public methodGetOverflowAttribute
[Win10_15063] Gets an overflow attribute.
Public methodGetPreviousSibling
[Win10_15063] Gets the previous sibling of the specified element, or null if there is no previous sibling.
Public methodGetRectangleAttribute
[Win10_15063] Gets a rectangle attribute.
Public methodGetStringAttribute
[Win10_15063] Gets a string attribute.
Public methodGetTransformAttribute
[Win10_15063] Gets a transform attribute.
Public methodGetUnitsAttribute
[Win10_15063] Gets a units attribute.
Public methodGetVisibilityAttribute
[Win10_15063] Gets a visibility attribute.
Public methodInsertChildBefore
[Win10_15063] Inserts a child before the specified child.
Public methodIsAttributeSpecified(String)
[Win10_15063] Returns whether an attribute was specified for this element.
Public methodIsAttributeSpecified(String, Boolean)
[Win10_15063] Returns whether an attribute was specified for this element.
Public methodRemoveAttribute
[Win10_15063] Removes the specified attribute from this element.
Public methodRemoveChild
[Win10_15063] Removes the a child from this element.
Public methodReplaceChild
[Win10_15063] Replaces a child of this element.
Public methodSetAspectRatioAttribute
[Win10_15063] Sets an aspect ratio attribute, which consists of alignment and scaling.
Public methodSetAttribute
[Win10_15063] Sets an object attribute.
Public methodSetCapStyleAttribute
[Win10_15063] Sets a cap style attribute.
Public methodSetColorAttribute
[Win10_15063] Sets a color attribute.
Public methodSetDisplayAttribute
[Win10_15063] Sets a display attribute.
Public methodSetEdgeBehaviorAttribute
[Win10_15063] Sets an edge behavior attribute.
Public methodSetFilledRegionDeterminationAttribute
[Win10_15063] Sets a filled region determination attribute.
Public methodSetFloatAttribute
[Win10_15063] Sets a float attribute.
Public methodSetIdAttribute
[Win10_15063] Sets an ID attribute.
Public methodSetLengthAttribute
[Win10_15063] Sets a length attribute, specifying both a value and what type of units that value is in.
Public methodSetLineJoinAttribute
[Win10_15063] Sets a line join attribute.
Public methodSetOverflowAttribute
[Win10_15063] Sets an overflow attribute.
Public methodSetRectangleAttribute
[Win10_15063] Sets a rectangle attribute.
Public methodSetStringAttribute
[Win10_15063] Sets a string attribute.
Public methodSetTransformAttribute
[Win10_15063] Sets a transform attribute.
Public methodSetUnitsAttribute
[Win10_15063] Sets a units attribute.
Public methodSetVisibilityAttribute
[Win10_15063] Sets a visibility attribute.

This API is only available when running on Windows 10 build 15063 (Creators Update) or greater.

An SVG element belongs to at most one document. An element created using LoadElementFromXml(String) or LoadElementAsync(IRandomAccessStream) is initially assigned no parent document. Here's an example of what it looks like to create an element and assign it to a document:

svgDocument = new CanvasSvgDocument(sender);

var path = svgDocument.LoadElementFromXml("<path d=\"M50,0 100,0 75,100 z\"/>");
var rectangle = svgDocument.LoadElementFromXml("<rect width=\"10\" height=\"10\"/>");


An SVG element can be assigned to a different document than the one it was created with, but any document it's assigned to needs to share the same device as the element.

See Also