Inline.TextDecorations Propiedad

Definición

Obtiene una TextDecorationCollection que contiene decoraciones de texto que se van a aplicar a este 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

Valor de propiedad

TextDecorationCollection

Colección TextDecorationCollection que contiene las decoraciones de texto que se van a aplicar a este elemento.

El valor predeterminado es null (no se aplica ninguna decoración de texto).

Ejemplos

En el ejemplo siguiente se muestra cómo establecer el TextDecorations atributo de un Inline elemento (Run).

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

En la ilustración siguiente se muestra cómo se representa este ejemplo.

Captura de pantalla: Texto con efecto de tachado predeterminado

Las ilustraciones siguientes muestran cómo se representan las decoraciones Overline, Baseline y Underline , respectivamente.

Captura de pantalla: TextDecorator de línea alta

Captura de pantalla: Efecto de línea base predeterminada en texto

Captura de pantalla: Texto con efecto de subrayado predeterminado

En el ejemplo siguiente se muestra cómo establecer la TextDecorations propiedad mediante programación.

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

Comentarios

Un TextDecoration objeto es un adorno visual que se puede agregar al texto. Hay cuatro tipos de decoraciones de texto: subrayado, línea base, tachado y sobrelineado. Para obtener más información sobre las decoraciones de texto, vea How to: Create a Text Decoration.

Información sobre propiedades de dependencia

Campo identificador TextDecorationsProperty
Propiedades de metadatos establecidas en true AffectsRender

Se aplica a