Right-to-left (RTL) support is used to display languages, such as Hebrew, which are right-aligned by default. Windows Phone XAML apps support RTL out of the box.
By setting the FlowDirection
property on any FrameworkElement
object, you can control whether text is presented from left to right (the default) or right to left. For example, a right-to-left flow direction can be applied to a TextBlock
as shown:
<TextBlock FlowDirection="RightToLeft" />
Alternatively, a right-to-left flow direction can be applied to all elements on a page, like so:
<phone:PhoneApplicationPage
...
FlowDirection="RightToLeft">
...
</phone:PhoneApplicationPage>
The FlowDirection
property is bindable. The sample’s LocalizabilityViewModel
class contains a FlowDirection
property. The FlowDirection
property of the LocalizabilityView
page is bound to this property. When switching to Arabic, the viewmodel changes the flow direction to right to left.
Figure 19.10 demonstrates the effect of a right-to-left flow direction on the sample page.
18.221.136.142