FlowDocument.IsOptimalParagraphEnabled 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定值,這個值表示要啟用或停用最佳段落配置。
public:
property bool IsOptimalParagraphEnabled { bool get(); void set(bool value); };
public bool IsOptimalParagraphEnabled { get; set; }
member this.IsOptimalParagraphEnabled : bool with get, set
Public Property IsOptimalParagraphEnabled As Boolean
屬性值
如果啟用最佳段落配置則為 true
,否則為 false
。 預設為 false
。
範例
下列範例示範如何設定 IsOptimalParagraphEnabled 專案的 屬性 FlowDocument 。
<FlowDocumentReader>
<FlowDocument
TextAlignment="Justify"
IsHyphenationEnabled="True"
IsOptimalParagraphEnabled="True"
Background="LightGray"
PageWidth="400" PageHeight="480"
>
<Paragraph>
<Hyperlink NavigateUri="http://www.xbox.com/en-US/games/p/perfectdarkzero/default.htm">
Perfect Dark Zero
</Hyperlink>
</Paragraph>
<Paragraph>
Joanna Dark returns in the Xbox 360 exclusive <Bold><Italic>Perfect Dark Zero</Italic></Bold>, the
prequel to the internationally award-winning and multi-million selling first-person shooter
<Italic>Perfect Dark</Italic> from famed game developer Rare.
</Paragraph>
<Paragraph>
A secret war has begun between shadowy corporations bent on world domination. Joanna Dark and her father
Jack are caught up in the fight for the future of the planet. A routine bounty hunting mission rips open
a global conspiracy that will change Joanna's destiny—forever.
</Paragraph>
<Paragraph>
Guide Joanna Dark on her journey to become the perfect agent. Featuring a compelling and captivating story,
<Italic>Perfect Dark Zero</Italic> plunges you into a world of corporate espionage and conspiracy. The title
merges the excitement and intrigue of its predecessor with revolutionary game design, cutting-edge online play,
and amazing graphics to deliver an experience that defines next-generation gaming and entertainment...
</Paragraph>
</FlowDocument>
</FlowDocumentReader>
下圖顯示上述 FlowDocument 轉譯的方式。
下圖顯示相同的 FlowDocument 轉譯方式,其預設設定為 = IsOptimalParagraphEnabled false
。
下列範例示範如何以程式設計方式設定 IsOptimalParagraphEnabled 屬性。
FlowDocument flowDoc = new FlowDocument(new Paragraph(new Run("A bit of text content...")));
// Enable automatic hyphenation.
flowDoc.IsHyphenationEnabled = true;
// Enable optimal paragraph layout.
flowDoc.IsOptimalParagraphEnabled = true;
Dim flowDoc As New FlowDocument(New Paragraph(New Run("A bit of text content...")))
' Enable automatic hyphenation.
flowDoc.IsHyphenationEnabled = True
' Enable optimal paragraph layout.
flowDoc.IsOptimalParagraphEnabled = True
備註
最佳段落配置是一項功能,可在 中 FlowDocument 配置段落,以便盡可能平均分散空白字元。 理論上,這會藉由消除可能會因為行對齊文字和其他版面配置常式而發生的分心空白字元,來提供優化的閱讀體驗。 最佳段落配置與屬性所代表 IsHyphenationEnabled 的自動斷字 (結合時特別有效) 。
相依性屬性資訊
識別碼欄位 | IsOptimalParagraphEnabledProperty |
中繼資料屬性設定為 true |
AffectsMeasure |