Export (0) Print
Expand All

XmlLanguage Class

Represents culture information for use in XML and XAML markup.

System.Object
  System.Windows.Markup.XmlLanguage

Namespace:  System.Windows.Markup
Assembly:  System.Windows (in System.Windows.dll)

public sealed class XmlLanguage
<object property="prefix"/>
- or -
<object property="prefix-subcode"/>

XAML Values

prefix

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, "".

subcode

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.

The XmlLanguage type exposes the following members.

  NameDescription
Public propertySupported by Silverlight for Windows PhoneIetfLanguageTagGets the string representation of the language tag.
Top

  NameDescription
Public methodSupported by Silverlight for Windows PhoneEqualsChecks for equality of an object to the current object. (Overrides Object.Equals(Object).)
Protected methodSupported by Silverlight for Windows PhoneFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetHashCodeServes as a hash function for the XmlLanguage class. (Overrides Object.GetHashCode().)
Public methodStatic memberSupported by Silverlight for Windows PhoneGetLanguageReturns a XmlLanguage instance, based on a string representing the language per RFC 3066.
Public methodSupported by Silverlight for Windows PhoneGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public operatorStatic memberSupported by Silverlight for Windows PhoneEqualityDetermines whether two specified XmlLanguage objects have the same value.
Public operatorStatic memberSupported by Silverlight for Windows PhoneInequalityDetermines whether two specified XmlLanguage objects have a different value.
Top

The culture information may or may not have a registered CultureInfo present on the system where the XML is interpreted.

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

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

In general, the construction syntax for XmlLanguage in XAML and code parallels the constructor syntax for CultureInfo, at least in terms of the meaning of the input string.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft