Get Method
Collapse the table of content
Expand the table of content

XName.Get Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets an XName object.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  NameDescription
Public method Static member Get(String) Gets an XName object from an expanded name.
Public method Static member Get(String, String) Gets an XName object from a local name and a namespace.
Top

This method provides overloads that allow you to create an XName from a expanded XML name. You can create an XName from a string in the form {namespace}localname, or from a namespace and a local name, specified separately.

A much more common and easier way to create an XName is to use the implicit conversion from string. To create a name that is in a namespace, the common approach is to use the addition operator overload that allows you to combine an XNamespace object and a string.

Because XName objects are atomized, if there is an existing XName with exactly the same name, the assigned variable will refer to the existing XName. If there is no existing XName, a new one will be created and initialized.

Show:
© 2017 Microsoft