FlowDocument.FlowDirection 属性

定义

获取或设置 FlowDocument 中内容流的相对方向。

public:
 property System::Windows::FlowDirection FlowDirection { System::Windows::FlowDirection get(); void set(System::Windows::FlowDirection value); };
public System.Windows.FlowDirection FlowDirection { get; set; }
member this.FlowDirection : System.Windows.FlowDirection with get, set
Public Property FlowDirection As FlowDirection

属性值

FlowDirection

FlowDirection 值之一,指定相对流动方向。 默认值为 LeftToRight

示例

以下示例演示如何设置 FlowDirection 元素的属性 FlowDocument

<FlowDocumentReader>
  <FlowDocument 
    FlowDirection="LeftToRight"
  >
    <Paragraph>
      The FlowDirection of content typically corresponds to the innate flow direction
      of the language being represented.  Hebrew and Arabic provide examples of
      languages that naturally flow from right-to-left.  English, German, and Russian
      provide examples of languages that naturally flow from left-to-right.
    </Paragraph>
  </FlowDocument>
</FlowDocumentReader>

以下示例演示如何以编程方式设置 FlowDirection 属性。

FlowDocument flowDoc = new FlowDocument(new Paragraph(new Run("A bit of text content...")));
// Set the content flow direction to left-to-right.
flowDoc.FlowDirection = System.Windows.FlowDirection.LeftToRight;
Dim flowDoc As New FlowDocument(New Paragraph(New Run("A bit of text content...")))
' Set the content flow direction to left-to-right.
flowDoc.FlowDirection = System.Windows.FlowDirection.LeftToRight

注解

获取此属性将返回当前有效的流动方向。 设置此属性会导致在指示的方向中重排的内容 FlowDocument

内容 FlowDirection 通常对应于所表示语言的内在流方向。 希伯来语和阿拉伯语是自然从右向左流动的语言示例。 英语、德语和俄语是自然从左向右流动的语言示例。

备注

此属性的值不会自动更改,以匹配操作系统使用的语言。 如果需要使用不同的值,则默认值 LeftToRight必须自行指定。

依赖项属性信息

标识符字段 FlowDirectionProperty
元数据属性设置为 true AffectsParentArrange, Inherits

适用于