Bagikan melalui


FlowDocument.IsOptimalParagraphEnabled Properti

Definisi

Mendapatkan atau menetapkan nilai yang menunjukkan apakah tata letak paragraf optimal diaktifkan atau dinonaktifkan.

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

Nilai Properti

true jika tata letak paragraf optimal diaktifkan; jika tidak, false. Defaultnya adalah false.

Contoh

Contoh berikut menunjukkan cara mengatur IsOptimalParagraphEnabled atribut FlowDocument elemen.

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

Gambar berikut menunjukkan bagaimana render sebelumnya FlowDocument .

Cuplikan layar: Cuplikan layar yang diaktifkan tanda hubung FlowDocument

Gambar berikut menunjukkan bagaimana hal yang sama FlowDocument dirender dengan pengaturan IsOptimalParagraphEnabled=falsedefault .

Cuplikan layar: FlowDocument dengan cuplikan layar tanda hubung yang dinonaktifkan

Contoh berikut menunjukkan cara mengatur properti IsOptimalParagraphEnabled secara terprogram.

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

Keterangan

Tata letak paragraf optimal adalah fitur yang menjabarkan paragraf sewaktu-waktu FlowDocument sehingga spasi kosong didistribusikan secara merata. Secara teoritis, ini memberikan pengalaman membaca yang dioptimalkan dengan menghilangkan mengganggu ruang putih yang dapat terjadi dengan teks yang dibenarkan garis dan rutinitas tata letak lainnya. Tata letak paragraf yang optimal sangat efektif ketika digabungkan dengan tanda hubung otomatis (diwakili oleh IsHyphenationEnabled properti ).

Informasi Properti Dependensi

Item Nilai
Bidang pengidentifikasi IsOptimalParagraphEnabledProperty
Properti metadata diatur ke true AffectsMeasure

Berlaku untuk