FlowDocument.IsOptimalParagraphEnabled FlowDocument.IsOptimalParagraphEnabled FlowDocument.IsOptimalParagraphEnabled FlowDocument.IsOptimalParagraphEnabled Property

Definición

Obtiene o establece un valor que indica si el diseño de párrafos óptimo está habilitado o deshabilitado.Gets or sets a value that indicates whether optimal paragraph layout is enabled or disabled.

public:
 property bool IsOptimalParagraphEnabled { bool get(); void set(bool value); };
public bool IsOptimalParagraphEnabled { get; set; }
member this.IsOptimalParagraphEnabled : bool with get, set
Public Property IsOptimalParagraphEnabled As Boolean

Valor de propiedad

true si el diseño de párrafos óptimo está habilitado; de lo contrario, false.true if optimal paragraph layout is enabled; otherwise, false. De manera predeterminada, es false.The default is false.

Ejemplos

En el ejemplo siguiente se muestra cómo establecer IsOptimalParagraphEnabled el atributo de FlowDocument un elemento.The following example shows how to set the IsOptimalParagraphEnabled 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>

En la ilustración siguiente se muestra cómo FlowDocument se representa el anterior.The following figure shows how the preceding FlowDocument renders.

![Captura Captura de pantalla]habilitada(~/add/media/flowdoc-hyphenenabled.png "para guiones de FlowDocument: Guion de FlowDocument habilitado")Screenshot: FlowDocument hyphen enabled

En la ilustración siguiente se muestra cómo FlowDocument se representa el mismo con la configuración IsOptimalParagraphEnabledpredeterminada de =. falseThe following figure shows how the same FlowDocument renders with the default setting of IsOptimalParagraphEnabled=false.

![Captura Captura de pantalla de FlowDocument]con guiones deshabilitados:(~/add/media/flowdoc-hyphendisabled.png " FlowDocument con guiones deshabilitados")Screenshot: FlowDocument with disabled hyphens

En el ejemplo siguiente se muestra cómo establecer IsOptimalParagraphEnabled la propiedad mediante programación.The following example shows how to set the IsOptimalParagraphEnabled 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

El diseño de párrafos óptimos es una característica que coloca los FlowDocument párrafos en el modo en que se distribuyen los espacios en blanco lo más uniformemente posible.Optimal paragraph layout is a feature that lays out paragraphs in the FlowDocument such that white space is distributed as evenly as possible. En teoría, esto proporciona una experiencia de lectura optimizada al eliminar el espacio en blanco que puede producirse con texto justificado por línea y otras rutinas de diseño.Theoretically, this provides an optimized reading experience by eliminating distracting white space that can occur with line-justified text and other layout routines. El diseño de párrafos óptimos es particularmente eficaz cuando se acopla con la división IsHyphenationEnabled automática de guiones (representada por la propiedad).Optimal paragraph layout is particularly effective when coupled with automatic hyphenation (represented by the IsHyphenationEnabled property).

Información sobre propiedades de dependenciaDependency Property Information

Campo de identificadorIdentifier field IsOptimalParagraphEnabledProperty
Propiedades de metadatos establecidas entrueMetadata properties set to true AffectsMeasure

Se aplica a