FlowDocument.IsHyphenationEnabled FlowDocument.IsHyphenationEnabled FlowDocument.IsHyphenationEnabled FlowDocument.IsHyphenationEnabled Property

定義

単語の自動ハイフネーションが有効かどうかを示す値を取得または設定します。Gets or sets a value that indicates whether automatic hyphenation of words is enabled or disabled.

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。それ以外の場合は falsetrue if automatic breaking and hyphenation of words is enabled; otherwise, false. 既定値は、false です。The default is false.

要素の属性IsHyphenationEnabledを設定する方法を次の例に示します。 FlowDocumentThe following example shows how to set the IsHyphenationEnabled attribute of a FlowDocument element.

<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のがどのようにレンダリングされるかを示しています。The following figure shows how the preceding FlowDocument renders.

![スクリーンFlowDocument ハイフンが]有効な(~/add/media/flowdoc-hyphenenabled.png "スクリーンショット:FlowDocument ハイフン有効")Screenshot: FlowDocument hyphen enabled

次のFlowDocument図は、のIsHyphenationEnabled = false既定の設定で同じ描画を行う方法を示しています。The following figure shows how the same FlowDocument renders with the default setting of IsHyphenationEnabled=false.

スクリーン無効なハイフンScreenshot: FlowDocument with disabled hyphens

次の例では、プログラムをIsHyphenationEnabled使用してプロパティを設定する方法を示します。The following example shows how to set the IsHyphenationEnabled property programmatically.

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すると、現在のレイアウト条件に基づいて、で自動的に単語の分割とハイフネーションを行うことができます。The automatic word hyphenation feature enables a FlowDocument to automatically break and hyphenate words, based on current layout conditions. これにより、長い単語を1行で開始し、次に進むことができます。また、均等に配置されたテキストに空白が均等に分散される傾向があります。This enables long words to begin on one line and continue on this next, and tends to achieve a more even distribution of white space in justified text. 単語は、標準の文法規則に従って分割され、ハイフネーションが適用されます。Words are broken and hyphenated according to standard grammar rules. 自動ハイフネーションは、 IsOptimalParagraphEnabled最適な段落レイアウト (プロパティで表されます) と組み合わせた場合に特に有効です。Automatic hyphenation is particularly effective when coupled with optimal paragraph layout (represented by the IsOptimalParagraphEnabled property).

依存プロパティ情報Dependency Property Information

識別子フィールドIdentifier field IsHyphenationEnabledProperty
メタデータプロパティがに設定されるtrueMetadata properties set to true AffectsMeasureAffectsRenderInheritsAffectsMeasure, AffectsRender, Inherits

適用対象