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

適用於