Partilhar via


FlowDocument.IsHyphenationEnabled Propriedade

Definição

Obtém ou define um valor que indica se a hifenização automática de palavras está habilitada ou desabilitada.

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

Valor da propriedade

true se a quebra automática e a hifenização de palavras estiverem habilitadas; caso contrário, false. O padrão é false.

Exemplos

O exemplo a seguir mostra como definir o IsHyphenationEnabled atributo de um FlowDocument elemento.

<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>

A figura a seguir mostra como as renderizações anteriores FlowDocument .

Captura de tela: Hífen FlowDocument habilitado

A figura a seguir mostra como o mesmo FlowDocument é renderizado com a configuração padrão de=IsHyphenationEnabledfalse .

Captura de tela: FlowDocument com hifens desabilitados

O exemplo a seguir mostra como definir a propriedade IsHyphenationEnabled programaticamente.

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

Comentários

O recurso de hifenização automática de palavras permite FlowDocument interromper e hifenizar palavras automaticamente, com base nas condições de layout atuais. Isso permite que palavras longas comecem em uma linha e continuem nesta próxima e tendem a obter uma distribuição mais uniforme do espaço em branco em texto justificado. As palavras são quebradas e hifenizadas de acordo com as regras gramaticais padrão. A hifenização automática é particularmente eficaz quando associada ao layout de parágrafo ideal (representado pela IsOptimalParagraphEnabled propriedade).

Informações da propriedade Dependency

Item Valor
Campo identificador IsHyphenationEnabledProperty
Propriedades de metadados definidas como true AffectsMeasure, , AffectsRenderInherits

Aplica-se a