CanvasSvgNamedElement Class |
Namespace: Microsoft.Graphics.Canvas.Svg
public sealed class CanvasSvgNamedElement : ICanvasSvgElement, IDisposable
The CanvasSvgNamedElement type exposes the following members.
Name | Description | |
---|---|---|
ContainingDocument | [Win10_15063] Gets the document which contains this element. | |
Device | [Win10_15063] Gets the device associated with this SVG element. | |
FirstChild | [Win10_15063] Gets this element's first child. | |
HasChildren | [Win10_15063] Gets whether this element has any children. | |
LastChild | [Win10_15063] Gets this element's last child. | |
Parent | [Win10_15063] Gets theis element's parent. | |
SpecifiedAttributes | [Win10_15063] Gets an array containing the set of attributes specified for this element. | |
Tag | [Win10_15063] Gets the name of this element. |
Name | Description | |
---|---|---|
AppendChild | [Win10_15063] Appends a child element to this element. | |
CreateAndAppendNamedChildElement | [Win10_15063] Creates a new named element and appends it to this element's children. | |
CreateAndAppendTextChildElement | [Win10_15063] Creates a new text element and appends it to this element's children. | |
Dispose | [Win10_15063] Releases all resources used by the CanvasSvgNamedElement. | |
GetAspectRatioAttribute | [Win10_15063] Gets an aspect ratio attribute, retrieving both the alignment and scaling. | |
GetAttribute | [Win10_15063] Gets an object attribute. | |
GetCapStyleAttribute | [Win10_15063] Gets a cap style attribute. | |
GetColorAttribute | [Win10_15063] Gets a color attribute. | |
GetDisplayAttribute | [Win10_15063] Gets a display attribute. | |
GetEdgeBehaviorAttribute | [Win10_15063] Gets an edge behavior attribute. | |
GetFilledRegionDeterminationAttribute | [Win10_15063] Gets a filled region determination attribute. | |
GetFloatAttribute | [Win10_15063] Gets a float attribute. | |
GetIdAttribute | [Win10_15063] Gets an ID attribute. | |
GetLengthAttribute | [Win10_15063] Gets a length attribute, where both a value and the type of units that value is in are retrieved. | |
GetLineJoinAttribute | [Win10_15063] Gets a line join attribute. | |
GetNextSibling | [Win10_15063] Gets the next sibling of the specified element, or null if there is no next sibling. | |
GetOverflowAttribute | [Win10_15063] Gets an overflow attribute. | |
GetPreviousSibling | [Win10_15063] Gets the previous sibling of the specified element, or null if there is no previous sibling. | |
GetRectangleAttribute | [Win10_15063] Gets a rectangle attribute. | |
GetStringAttribute | [Win10_15063] Gets a string attribute. | |
GetTransformAttribute | [Win10_15063] Gets a transform attribute. | |
GetUnitsAttribute | [Win10_15063] Gets a units attribute. | |
GetVisibilityAttribute | [Win10_15063] Gets a visibility attribute. | |
InsertChildBefore | [Win10_15063] Inserts a child before the specified child. | |
IsAttributeSpecified(String) | [Win10_15063] Returns whether an attribute was specified for this element. | |
IsAttributeSpecified(String, Boolean) | [Win10_15063] Returns whether an attribute was specified for this element. | |
RemoveAttribute | [Win10_15063] Removes the specified attribute from this element. | |
RemoveChild | [Win10_15063] Removes the a child from this element. | |
ReplaceChild | [Win10_15063] Replaces a child of this element. | |
SetAspectRatioAttribute | [Win10_15063] Sets an aspect ratio attribute, which consists of alignment and scaling. | |
SetAttribute | [Win10_15063] Sets an object attribute. | |
SetCapStyleAttribute | [Win10_15063] Sets a cap style attribute. | |
SetColorAttribute | [Win10_15063] Sets a color attribute. | |
SetDisplayAttribute | [Win10_15063] Sets a display attribute. | |
SetEdgeBehaviorAttribute | [Win10_15063] Sets an edge behavior attribute. | |
SetFilledRegionDeterminationAttribute | [Win10_15063] Sets a filled region determination attribute. | |
SetFloatAttribute | [Win10_15063] Sets a float attribute. | |
SetIdAttribute | [Win10_15063] Sets an ID attribute. | |
SetLengthAttribute | [Win10_15063] Sets a length attribute, specifying both a value and what type of units that value is in. | |
SetLineJoinAttribute | [Win10_15063] Sets a line join attribute. | |
SetOverflowAttribute | [Win10_15063] Sets an overflow attribute. | |
SetRectangleAttribute | [Win10_15063] Sets a rectangle attribute. | |
SetStringAttribute | [Win10_15063] Sets a string attribute. | |
SetTransformAttribute | [Win10_15063] Sets a transform attribute. | |
SetUnitsAttribute | [Win10_15063] Sets a units attribute. | |
SetVisibilityAttribute | [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\"/>"); svgDocument.Root.AppendChild(path); svgDocument.Root.AppendChild(rectangle);
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.