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

Definición

Obtiene o establece un valor que indica si la división automática de palabras está habilitada o deshabilitada.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

Valor de propiedad

true si se habilitan la separación y la división de palabras; de lo contrario, false.true if automatic breaking and hyphenation of words is enabled; otherwise, false. De manera predeterminada, es false.The default is false.

Ejemplos

El ejemplo siguiente muestra cómo establecer el IsHyphenationEnabled atributo de un FlowDocument elemento.The 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>

La siguiente ilustración muestra cómo anterior FlowDocument representa.The following figure shows how the preceding FlowDocument renders.

Captura de pantalla: FlowDocument con guiones habilitadosScreenshot: FlowDocument hyphen enabled

La siguiente ilustración muestra cómo el mismo FlowDocument se representa con la configuración predeterminada de IsHyphenationEnabled = false.The following figure shows how the same FlowDocument renders with the default setting of IsHyphenationEnabled=false.

Captura de pantalla: FlowDocument con guiones deshabilitadosScreenshot: FlowDocument with disabled hyphens

El ejemplo siguiente muestra cómo establecer el IsHyphenationEnabled propiedad mediante programación.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

Comentarios

La característica de división de palabras automática permite un FlowDocument para interrumpir y separar las palabras, según las condiciones actuales de diseño automáticamente.The automatic word hyphenation feature enables a FlowDocument to automatically break and hyphenate words, based on current layout conditions. Esto permite a esas palabras largas empezar en una sola línea y continuar en la siguiente y tiende a lograr una distribución más uniforme de espacio en blanco en texto justificado.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. Las palabras se divide y guiones con según las reglas gramaticales estándar.Words are broken and hyphenated according to standard grammar rules. División de palabras automática es especialmente eficaz cuando se combina con el diseño de párrafos óptimo (representado por la IsOptimalParagraphEnabled propiedad).Automatic hyphenation is particularly effective when coupled with optimal paragraph layout (represented by the IsOptimalParagraphEnabled property).

Información sobre propiedades de dependenciaDependency Property Information

Campo de identificadorIdentifier field IsHyphenationEnabledProperty
Establecen las propiedades de metadatos en trueMetadata properties set to true AffectsMeasure, AffectsRender, InheritsAffectsMeasure, AffectsRender, Inherits

Se aplica a