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 及其設定為字串 "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: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
設定為 true 的中繼資料屬性Metadata properties set to true Inherits

適用於