FlowDocument.IsHyphenationEnabled プロパティ

定義

単語の自動ハイフネーションが有効かどうかを示す値を取得または設定します。

public:
 property bool IsHyphenationEnabled { bool get(); void set(bool value); };
public bool IsHyphenationEnabled { get; set; }
member this.IsHyphenationEnabled : bool with get, set
Public Property IsHyphenationEnabled As Boolean

プロパティ値

自動改行と単語の自動ハイフネーションが有効である場合は true。それ以外の場合は false。 既定値は、false です。

次の例は、 要素の 属性を設定する IsHyphenationEnabled 方法を 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 ハイフンが有効な

次の図は、 の既定の設定IsHyphenationEnabled=falseで同じFlowDocumentをレンダリングする方法を示しています。

スクリーンショット: 無効なハイフンを含む FlowDocument

次の例では、IsHyphenationEnabled プロパティをプログラムで設定する方法が示されています。

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 現在のレイアウト条件に基づいて単語を自動的に中断およびハイフネーションできます。 これにより、長い単語が 1 行で始まり、次に続き、両端揃えテキストの空白がより均等に分散される傾向があります。 単語は、標準の文法規則に従って壊れ、ハイフネーションされます。 自動ハイフネーションは、(プロパティで表される) 最適な段落レイアウトと組み合わせて使用する場合に特に IsOptimalParagraphEnabled 有効です。

依存プロパティ情報

識別子フィールド IsHyphenationEnabledProperty
に設定されたメタデータ プロパティ true AffectsMeasure, AffectsRender, Inherits

適用対象