TextReadingOrder Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides a value for TextReadingOrder
properties.
public enum class TextReadingOrder
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
enum class TextReadingOrder
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
public enum TextReadingOrder
Public Enum TextReadingOrder
<object property="textReadingOrderMemberName"/>
- Inheritance
-
TextReadingOrder
- Attributes
Fields
Name | Value | Description |
---|---|---|
Default | 0 | Do not detect flow direction from content. Use FlowDirection value (if any) for reading order decisions. (Do not use. See Remarks.) |
UseFlowDirection | 0 | Do not detect flow direction from content. Use FlowDirection value (if any) for reading order decisions. (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
The enumeration value 0
has the constant name UseFlowDirection
, and is not the default value of TextReadingOrder
properties. All Windows 10 and later text controls set the default value of TextReadingOrder
to DetectFromContent
.
In Windows 8.1 UWP apps, the value 0
had the constant name Default
. It is included here for compatibility when migrating UWP apps to Windows App SDK. Do not use this in your apps on Windows 10 and later, use UseFlowDirection
instead.
The TextReadingOrder
property influences the reading order (left-to-right or right-to-left) of individual UI elements that contain bidirectional text. In Windows 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.