FlowDocument.IsHyphenationEnabled Propiedad

Definición

Obtiene o establece un valor que indica si la división automática de palabras está habilitada o deshabilitada.

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

true si se habilitan la separación y la división de palabras; de lo contrario, false. De manera predeterminada, es false.

Ejemplos

En el ejemplo siguiente se muestra cómo establecer el IsHyphenationEnabled atributo de un 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>

En la ilustración siguiente se muestra cómo se representa el anterior FlowDocument .

Captura de pantalla: FlowDocument hyphen enabled Captura

En la ilustración siguiente se muestra cómo se representa el mismo FlowDocument con la configuración predeterminada de=IsHyphenationEnabledfalse .

Captura de pantalla: FlowDocument con guiones deshabilitados Captura de pantalla

En el ejemplo siguiente se muestra cómo establecer la propiedad IsHyphenationEnabled mediante programación.

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

Comentarios

La característica de división automática de palabras permite FlowDocument interrumpir y guiones automáticamente palabras, en función de las condiciones de diseño actuales. Esto permite que las palabras largas comiencen en una línea y continúen en este siguiente, y tiende a lograr una distribución más uniforme del espacio en blanco en texto justificado. Las palabras se rompen y se guionan según las reglas de gramática estándar. La división automática es especialmente eficaz cuando se combina con un diseño de párrafo óptimo (representado por la IsOptimalParagraphEnabled propiedad ).

Información sobre propiedades de dependencia

Campo identificador IsHyphenationEnabledProperty
Propiedades de metadatos establecidas en true AffectsMeasure, AffectsRender, Inherits

Se aplica a