XmlLanguage.GetLanguage Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Returns a XmlLanguage instance, based on a string representing the language per RFC 3066.
Assembly: System.Windows (in System.Windows.dll)
'Declaration Public Shared Function GetLanguage ( _ ietfLanguageTag As String _ ) As XmlLanguage
Parameters
- ietfLanguageTag
- Type: System.String
An RFC 3066 language string, or an empty string ("").
Return Value
Type: System.Windows.Markup.XmlLanguageA new XmlLanguage with the provided string as its IetfLanguageTag value.
| Exception | Condition |
|---|---|
| ArgumentException | ietfLanguageTag cannot be processed as a valid IETF language. |
This method is effectively the constructor, and also supports the type conversion for XAML attribute usage.
The language string may be empty, or else must conform to RFC 3066 rules:
The first subtag must consist of only ASCII letters.
Additional subtags must consist of ASCII letters or numerals.
Subtags are separated by a single hyphen character.
Every subtag must be 1 to 8 characters long.
No leading or trailing hyphens are permitted.
By default an XmlLanguage has an empty value for its language component.