Compartir por


FlowDocument.Foreground Propiedad

Definición

Obtiene o establece el objeto Brush que se va a aplicar al contenido del texto de FlowDocument.

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

Valor de propiedad

Pincel usado para aplicar al contenido del texto. El valor predeterminado es Black.

Ejemplos

En el ejemplo siguiente se muestra cómo establecer el Foreground atributo de un FlowDocument elemento .

<FlowDocumentReader>
  <FlowDocument 
    Background="IndianRed"
    Foreground="NavajoWhite"
  >
    <Paragraph>
      This FlowDocument will have a background color of Indian red, with the text
      colored Navajo white.  Any Forground or Background settings on this paragraph
      would override the top-level settings for the FlowDocument.
    </Paragraph>
  </FlowDocument>
</FlowDocumentReader>

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

FlowDocument flowDoc = new FlowDocument(new Paragraph(new Run("A bit of text content...")));
flowDoc.Background = Brushes.IndianRed;
flowDoc.Foreground = Brushes.NavajoWhite;
Dim flowDoc As New FlowDocument(New Paragraph(New Run("A bit of text content...")))
flowDoc.Background = Brushes.IndianRed
flowDoc.Foreground = Brushes.NavajoWhite

Comentarios

Para obtener una tabla de muestras que muestra los colores de pincel predefinidos disponibles, vea Brushes.

Cualquier Foreground configuración de los elementos secundarios invalida esta configuración de nivel superior.

Información de la propiedad dependency

Elemento Importancia
Campo identificador ForegroundProperty
Propiedades de metadatos establecidas en true AffectsRender, , Inherits,

SubPropertiesDoNotAffectRender

Se aplica a