XmlLanguage XmlLanguage XmlLanguage XmlLanguage Class


Represents a language tag for use in XAML markup.

public ref class XmlLanguage
public class XmlLanguage
type XmlLanguage = class
Public Class XmlLanguage


The language tag may or may not have a registered CultureInfo present on the system where the XAML is interpreted.

This class is useful for dealing with values represented using xml:lang in XML.

Language tags can be specified in two-character form or in a hyphenated language-locale form. See RFC 3066.

Note that the XML specification allows the empty string for xml:lang, although that is not permitted by RFC 3066; therefore, the XmlLanguage type permits "" (empty attribute string). A default-constructed XmlLanguage behaves as if constructed with "" (empty string).

XAML Attribute Usage

<object property="prefix"/>  
- or -  
<object property="prefix-subcode"/>  

XAML Values

Language prefix, using the ISO 639-1 language prefix values. For example "en", or "zh". Uppercase values are accepted and converted to lowercase. This may also be an empty attribute, "".

If provided, must be preceded by a single hyphen. Then, a subcode as defined by RFC 3066. The most typical usage, and the one which is most likely to properly map to a CultureInfo, is a country or regional designation such as "-us" or "-hk". Uppercase values are accepted and converted to lowercase.


Empty Empty Empty Empty

Gets a static XmlLanguage instance as would be created by GetLanguage(String) with the language tag as an empty attribute string.

IetfLanguageTag IetfLanguageTag IetfLanguageTag IetfLanguageTag

Gets the string representation of the language tag.


Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEquivalentCulture() GetEquivalentCulture() GetEquivalentCulture() GetEquivalentCulture()

Returns the appropriate equivalent CultureInfo for this XmlLanguage, if and only if such a CultureInfo is registered for the IetfLanguageTag value of this XmlLanguage

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetLanguage(String) GetLanguage(String) GetLanguage(String) GetLanguage(String)

Returns a XmlLanguage instance, based on a string representing the language per RFC 3066.

GetSpecificCulture() GetSpecificCulture() GetSpecificCulture() GetSpecificCulture()

Returns the most-closely-related non-neutral CultureInfo for this XmlLanguage.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a String that represents the current XmlLanguage.

Applies to