Share via


TextReadingOrder Enum

Definition

Provides a value for TextReadingOrder properties.

public enum class TextReadingOrder
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
enum class TextReadingOrder
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public enum TextReadingOrder
Public Enum TextReadingOrder
<object property="textReadingOrderMemberName"/>
Inheritance
TextReadingOrder
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Fields

Name Value Description
Default 0

Do not detect flow direction from content. Use FlowDirection value (if any) for reading order decisions. (Windows 8.1 only. See Remarks.)

UseFlowDirection 0

Do not detect flow direction from content. Use FlowDirection value (if any) for reading order decisions. (Windows 10 only. See Remarks.)

DetectFromContent 1

Detect flow direction from text content. For bidirectional text, text containers will infer the reading order for text based on the content. See Remarks.

Remarks

Important

Starting with Windows 10, the enumeration value 0 has the constant name UseFlowDirection, and is not the default value of TextReadingOrder properties. All Windows 10 text controls set the default value of TextReadingOrder to DetectFromContent.

In Windows 8.1, the value 0 has the constant name Default. Do not use in Windows 10 apps.

The TextReadingOrder property influences the reading order (left-to-right or right-to-left) of individual UI elements that contain bidirectional text. In Windows 10 text controls this property has the default value of DetectFromContent so that content can be detected dynamically, rather than using the FlowDirection property on a content parent. The DetectFromContent logic uses the first strong character in each paragraph to determine the reading direction for the paragraph, based on the Unicode Bidirectional Algorithm, P2.

This property can be useful when the base direction of the text is unknown, and may not match the user's language or direction. For more info see How to support bidirectional UI.

If content is coming from data binding, this avoids the need for binding to FlowDirection with a converter that interprets right-to-left locale info that comes from the data.

Unlike FlowDirection and its logic, the reading order logic for DetectFromContent will not affect the alignment of the text within the text control, it just adjusts the order in which blocks of bidirectional text are laid out.

Applies to

See also