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

屬性值

XmlLanguage

這個項目的語言資訊。The language information for this element. 預設值是 XmlLanguage 及其設定為字串 "en-US" 的 IetfLanguageTag 值。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:langdefines the general meaning of the xml:lang attribute. Language 基本上會將這個屬性的意義公開為相依性屬性。Language essentially exposes the meaning of this attribute as a dependency property. Language 可以透過程式設計的方式進行調整,而且可以參與屬性系統值繼承,方法是讓 xml:lang 屬性繼承至中的子項目範圍 XMLXMLLanguage 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

適用於