Inline.TextDecorations Proprietà

Definizione

Ottiene un oggetto TextDecorationCollection contenente le decorazioni di testo da applicare a questo elemento.

public:
 property System::Windows::TextDecorationCollection ^ TextDecorations { System::Windows::TextDecorationCollection ^ get(); void set(System::Windows::TextDecorationCollection ^ value); };
public System.Windows.TextDecorationCollection TextDecorations { get; set; }
member this.TextDecorations : System.Windows.TextDecorationCollection with get, set
Public Property TextDecorations As TextDecorationCollection

Valore della proprietà

TextDecorationCollection

Oggetto TextDecorationCollection contenente le decorazioni di testo da applicare a questo elemento.

Il valore predefinito è Null (nessuna decorazione di testo applicata).

Esempio

Nell'esempio seguente viene illustrato come impostare l'attributo TextDecorations di un Inline elemento (Run).

<FlowDocument ColumnWidth="200">
  <Paragraph>
    <Run TextDecorations="Strikethrough">
      This text will render with the strikethrough effect.
    </Run>
  </Paragraph>
</FlowDocument>

La figura seguente illustra il rendering di questo esempio.

Schermata: testo con effetto Strikethrough predefinito

Le figure seguenti illustrano rispettivamente il rendering delle decorazioni Overline, Baseline e Sottolineatura .

Schermata: TextDecorator Overline

Schermata: effetto Baseline predefinito sul testo

Schermata: testo con effetto Underline predefinito

Nell'esempio seguente viene illustrato come impostare la TextDecorations proprietà a livello di codice.

Run run1 = new Run("This text will render with the strikethrough effect.");
run1.TextDecorations = TextDecorations.Strikethrough;
Dim run1 As New Run("This text will render with the strikethrough effect.")
run1.TextDecorations = TextDecorations.Strikethrough

Commenti

Un TextDecoration oggetto è un ornamento visivo che è possibile aggiungere al testo. Esistono quattro tipi di decorazioni di testo: sottolineatura, baseline, barratura e overline. Per altre informazioni sulle decorazioni di testo, vedere Procedura: Creare una decorazione di testo.

Informazioni proprietà di dipendenza

Campo Identificatore TextDecorationsProperty
Proprietà dei metadati impostate su true AffectsRender

Si applica a