Share via


FlowDocument.IsHyphenationEnabled Properti

Definisi

Mendapatkan atau menetapkan nilai yang menunjukkan apakah tanda hubung otomatis kata diaktifkan atau dinonaktifkan.

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

Nilai Properti

true jika pemecahan otomatis dan pemenaan kata diaktifkan; jika tidak, false. Defaultnya adalah false.

Contoh

Contoh berikut menunjukkan cara mengatur IsHyphenationEnabled 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: Tanda hubung FlowDocument diaktifkan

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

Cuplikan layar: FlowDocument dengan cuplikan layar tanda hubung yang dinonaktifkan

Contoh berikut menunjukkan cara mengatur IsHyphenationEnabled properti 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

Fitur pemenaan kata otomatis memungkinkan FlowDocument untuk secara otomatis memecah dan memberi tanda hubung kata, berdasarkan kondisi tata letak saat ini. Ini memungkinkan kata-kata panjang untuk memulai pada satu baris dan melanjutkan hal ini berikutnya, dan cenderung mencapai distribusi spasi putih yang lebih merata dalam teks yang dibenarkan. Kata-kata rusak dan dipengaruhi sesuai dengan aturan tata bahasa standar. Tanda hubung otomatis sangat efektif ketika digabungkan dengan tata letak paragraf yang optimal (diwakili oleh IsOptimalParagraphEnabled properti ).

Informasi Properti Dependensi

Bidang pengidentifikasi IsHyphenationEnabledProperty
Properti metadata diatur ke true AffectsMeasure, AffectsRender, Inherits

Berlaku untuk