Uredi

Deli z drugimi prek


NumberSubstitution Class

Definition

Specifies how numbers in text are displayed in different cultures.

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

Remarks

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

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. These conversion routines are coded to use Unicode digits "0030" through "0039".

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.

Note

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 Text Usage

This type is not typically used in XAML as an object element. However, the type exposes several attached properties that can be set on other object elements that have text content.

Constructors

NumberSubstitution()

Initializes a new instance of the NumberSubstitution class.

NumberSubstitution(NumberCultureSource, CultureInfo, NumberSubstitutionMethod)

Initializes a new instance of the NumberSubstitution class with explicit property values.

Fields

CultureOverrideProperty

Identifies the CultureOverride dependency property.

CultureSourceProperty

Identifies the CultureSource dependency property.

SubstitutionProperty

Identifies the Substitution dependency property.

Properties

CultureOverride

Gets or sets a value which identifies which culture to use when the value of the CultureSource property is set to Override.

CultureSource

Gets or sets a value which identifies the source of the culture value that is used to determine number substitution.

Substitution

Gets or sets a value which identifies the substitution method that is used to determine number substitution.

Methods

Equals(Object)

Determines whether the specified object is equal to the current NumberSubstitution object.

GetCultureOverride(DependencyObject)

Returns the value of CultureOverride from the provided element.

GetCultureSource(DependencyObject)

Returns the value of CultureSource from the provided element.

GetHashCode()

Serves as a hash function for NumberSubstitution. It is suitable for use in hashing algorithms and data structures such as a hash table.

GetSubstitution(DependencyObject)

Returns the value of Substitution from the provided element.

GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
SetCultureOverride(DependencyObject, CultureInfo)

Sets the value of CultureOverride for a provided element.

SetCultureSource(DependencyObject, NumberCultureSource)

Sets the value of CultureSource for a provided element.

SetSubstitution(DependencyObject, NumberSubstitutionMethod)

Sets the value of Substitution for a provided element.

ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to