FlowDocument.IsHyphenationEnabled Egenskap

Definition

Hämtar eller anger ett värde som anger om automatisk avstavning av ord är aktiverat eller inaktiverat.

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

Egenskapsvärde

trueom automatisk brytning och avstavning av ord är aktiverat; annars . false Standardvärdet är false.

Exempel

I följande exempel visas hur du anger attributet för IsHyphenationEnabled ett 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>

Följande bild visar hur föregående FlowDocument renderas.

Skärmbild: FlowDocument bindestreck aktiverat

Följande bild visar hur samma FlowDocument återgivningar med standardinställningen IsHyphenationEnabled=falseför .

Skärmbild: FlowDocument med inaktiverade bindestreck

I följande exempel visas hur du ställer in IsHyphenationEnabled-egenskapen programmatiskt.

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

Kommentarer

Funktionen för automatisk ordstavning gör det möjligt FlowDocument att automatiskt bryta och bindestrecka ord baserat på aktuella layoutvillkor. Detta gör det möjligt för långa ord att börja på en rad och fortsätta på den här nästa, och tenderar att uppnå en jämnare fördelning av tomt utrymme i berättigad text. Ord bryts och bindestreckas enligt standardregler för grammatik. Automatisk avstavning är särskilt effektiv när den kombineras med optimal styckelayout (representeras av egenskapen IsOptimalParagraphEnabled ).

Information om beroendeegenskap

Objekt Value
Identifierarfält IsHyphenationEnabledProperty
Metadataegenskaper inställda på true AffectsMeasure, , AffectsRenderInherits

Gäller för