Search
ShapeImportedEventArgs.ShapeXml Property
See Also
 





Gets the XML DOM element corresponding to the Visio document's XML code that describes the imported shape.

Namespace: MindFusion.Diagramming.Wpf.Import
Assembly: MindFusion.Diagramming.Wpf.VisioImport

 Syntax

C#  Copy Code

public XmlNode ShapeXml { get; }

Visual Basic  Copy Code

Public ReadOnly Property ShapeXml As XmlNode

 Property Value

An XmlNode object corresponding to the section of the VDX document which describes the imported shape.

 Example

The following sample shows how to read a custom property value defined in Visio by handling the ShapeImported event.

C#  Copy Code

private void ShapeImported(object sender, ShapeImportedEventArgs e)
{
    XmlNode vdxCode = e.ShapeXml;
    try
    {
        XmlNamespaceManager ns = new XmlNamespaceManager(e.ShapeXml.OwnerDocument.NameTable);
        ns.AddNamespace("vdx", "http://schemas.microsoft.com/visio/2003/core");

        XmlNode myPropVal = vdxCode.SelectSingleNode("vdx:Prop[vdx:Label='MyProperty']/vdx:Value", ns);
        if (myPropVal != null)
            e.Shape.Tag = myPropVal.InnerText;
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

 See Also