NumberSubstitution Class

Specifies how numbers in text are displayed in different cultures.

System.Object
  System.Windows.Media.NumberSubstitution

Namespace:  System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

public class NumberSubstitution
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.

The NumberSubstitution type exposes the following members.

  NameDescription
Public methodNumberSubstitution()Initializes a new instance of the NumberSubstitution class.
Public methodNumberSubstitution(NumberCultureSource, CultureInfo, NumberSubstitutionMethod)Initializes a new instance of the NumberSubstitution class with explicit property values.
Top

  NameDescription
Public propertyCultureOverrideGets or sets a value which identifies which culture to use when the value of the CultureSource property is set to Override.
Public propertyCultureSourceGets or sets a value which identifies the source of the culture value that is used to determine number substitution.
Public propertySubstitutionGets or sets a value which identifies the substitution method that is used to determine number substitution.
Top

  NameDescription
Public methodEqualsDetermines whether the specified object is equal to the current NumberSubstitution object. (Overrides Object.Equals(Object).)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodStatic memberGetCultureOverrideReturns the value of CultureOverride from the provided element.
Public methodStatic memberGetCultureSourceReturns the value of CultureSource from the provided element.
Public methodGetHashCodeServes as a hash function for NumberSubstitution. It is suitable for use in hashing algorithms and data structures such as a hash table. (Overrides Object.GetHashCode().)
Public methodStatic memberGetSubstitutionReturns the value of Substitution from the provided element.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodStatic memberSetCultureOverrideSets the value of CultureOverride for a provided element.
Public methodStatic memberSetCultureSourceSets the value of CultureSource for a provided element.
Public methodStatic memberSetSubstitutionSets the value of Substitution for a provided element.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public fieldStatic memberCultureOverridePropertyIdentifies the CultureOverride dependency property.
Public fieldStatic memberCultureSourcePropertyIdentifies the CultureSource dependency property.
Public fieldStatic memberSubstitutionPropertyIdentifies the Substitution dependency property.
Top

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.

Example of the appearance of digits in different cultures

Table of number substitution glyphs

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.

NoteNote

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.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft