NumberSubstitution 類別


指定文字中的數字於不同文化特性中的顯示方式。Specifies how numbers in text are displayed in different cultures.

public ref class NumberSubstitution
public class NumberSubstitution
type NumberSubstitution = class
Public Class NumberSubstitution


大部分的文化特性都會使用 decimal 系統來表示數位,但許多文化特性會使用不同的數位圖形。Most cultures use the decimal system to represent numbers, but many cultures use different digit shapes. 下表顯示不同文化特性所使用的數個編號系統。The following table shows several numbering systems used by different cultures.

數字替代字符一覽表Table of number substitution glyphs
不同文化特性中的數位外觀範例Example of the appearance of digits in different cultures

為每一組數位圖形提供替代的 Unicode 程式碼點並不足夠,因為與字母不同的是,計算中會使用數位。It is not sufficient to provide alternate Unicode code points for each set of digit shapes, because, unlike letters, digits are used in calculations. 每個應用程式、每個作業系統和每一個執行時間程式庫都包含專門用來將內部二進位格式的數值轉換為字元字串的程式碼,反之亦然。Every application, every operating system, and every run-time library contains code dedicated to converting an internal binary format numeric value to a string of characters, and vice versa. 這些轉換常式的編碼是使用 Unicode 數位 "0030" 到 "0039"。These conversion routines are coded to use Unicode digits "0030" through "0039".

NumberSubstitution類別所提供的功能,可讓不同文化特性在轉譯時期替換適當的數位圖形。The NumberSubstitution class provides functionality that allows different cultures to substitute the appropriate digit shapes at rendering time. 這項功能類似于用來提供字型替代和語言相依字型轉譯的功能。This functionality is similar to the one used for providing font substitution and language dependent font rendering.


許多文化特性會捨棄其傳統數位圖形並採用西方數位圖形,因此數位替換功能可辨識傳統數位圖形與國家/地區標準數位圖形之間的各文化特性差異。Many cultures are discarding their traditional digits shapes and adopting Western digits shapes, therefore the number substitution functionality recognizes the distinction for each culture between traditional digit shapes and national standard digit shapes.

XAML 文字使用方式XAML Text Usage

這種類型通常不會用來 XAMLXAML 做為物件元素。This type is not typically used in XAMLXAML as an object element. 不過,此類型會公開多個附加屬性,這些屬性可以在具有文字內容的其他物件元素上設定。However, the type exposes several attached properties that can be set on other object elements that have text content.



初始化 NumberSubstitution 類別的新執行個體。Initializes a new instance of the NumberSubstitution class.

NumberSubstitution(NumberCultureSource, CultureInfo, NumberSubstitutionMethod)

使用明確屬性值,初始化 NumberSubstitution 類別的新執行個體。Initializes a new instance of the NumberSubstitution class with explicit property values.



識別 CultureOverride 相依性屬性。Identifies the CultureOverride dependency property.


識別 CultureSource 相依性屬性。Identifies the CultureSource dependency property.


識別 Substitution 相依性屬性。Identifies the Substitution dependency property.



取得或設定當 CultureSource 屬性的數值設定為 Override 時,能識別使用何種文化特性的數值。Gets or sets a value which identifies which culture to use when the value of the CultureSource property is set to Override.


取得或設定值,這個值識別用來判斷數字替代之文化特性值的來源。Gets or sets a value which identifies the source of the culture value that is used to determine number substitution.


取得或設定值,這個值識別用來判斷數字替代的替代方法。Gets or sets a value which identifies the substitution method that is used to determine number substitution.



判斷指定的物件是否等於目前的 NumberSubstitution 物件。Determines whether the specified object is equal to the current NumberSubstitution object.


從提供的項目傳回 CultureOverride 的值。Returns the value of CultureOverride from the provided element.


從提供的項目傳回 CultureSource 的值。Returns the value of CultureSource from the provided element.


作為 NumberSubstitution 的雜湊函式。Serves as a hash function for NumberSubstitution. 它適用於雜湊演算法和資料結構,例如雜湊資料表。It is suitable for use in hashing algorithms and data structures such as a hash table.


從提供的項目傳回 Substitution 的值。Returns the value of Substitution from the provided element.


取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
SetCultureOverride(DependencyObject, CultureInfo)

為提供的項目設定 CultureOverride 的值。Sets the value of CultureOverride for a provided element.

SetCultureSource(DependencyObject, NumberCultureSource)

為提供的項目設定 CultureSource 的值。Sets the value of CultureSource for a provided element.

SetSubstitution(DependencyObject, NumberSubstitutionMethod)

為提供的項目設定 Substitution 的值。Sets the value of Substitution for a provided element.


傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)