FrameworkElement.Language 属性

定义

获取或设置应用于某个元素的本地化/全球化语言信息。Gets or sets localization/globalization language information that applies to an element.

public:
 property System::Windows::Markup::XmlLanguage ^ Language { System::Windows::Markup::XmlLanguage ^ get(); void set(System::Windows::Markup::XmlLanguage ^ value); };
public System.Windows.Markup.XmlLanguage Language { get; set; }
member this.Language : System.Windows.Markup.XmlLanguage with get, set
Public Property Language As XmlLanguage

属性值

此元素的语言信息。The language information for this element. 默认值为 XmlLanguage,它的 IetfLanguageTag 值设置为字符串 "zh-CN"。The default value is an XmlLanguage with its IetfLanguageTag value set to the string "en-US".

注解

字符串格式遵循 RFC 3066 标准。The string formats follow the RFC 3066 standard. 例如,美国英语为 "en-us"。For example, U.S. English is "en-US". 有关值和格式的详细信息,请参阅 XmlLanguageFor more information on the values and format, see XmlLanguage.

此依赖属性继承属性值。This dependency property inherits property values. 如果有子元素没有通过本地值或样式建立 Language 的其他值,则属性系统会将该值设置为已分配此值的最近上级元素的 Language 值。If there are child elements without other values for Language established through local values or styles, the property system will set the value to be the Language value of the nearest ancestor element with this value assigned.

XMLXML 定义 xml:lang 特性的一般含义。defines the general meaning of the xml:lang attribute. Language 实质上是将此属性的含义公开为依赖属性。Language essentially exposes the meaning of this attribute as a dependency property. 可以通过编程方式调整 Language,并以与 xml:lang 属性可以继承到 XMLXML中的子元素范围相同的方式参与属性系统值继承。Language can be adjusted programmatically, and can participate in property system value inheritance in a way that parallels how the xml:lang attribute can inherit to child element scope in XMLXML. 如果设置 Language,该值将成为 xml:lang 并覆盖以前的任何值。If you set Language, that value becomes the xml:lang and overwrites any previous value. 有关详细信息,请参阅XAML 中的 xml: Lang 处理For more information, see xml:lang Handling in XAML.

依赖项属性信息Dependency Property Information

标识符字段Identifier field LanguageProperty
元数据属性设置为 trueMetadata properties set to true Inherits

适用于