FlowDocument.Foreground Propiedad

Definición

Obtiene o establece el Brush que se va a aplicar al contenido de texto del 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 la aplicación al contenido de texto. De manera predeterminada, 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 propiedad Foreground 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 sobre propiedades de dependencia

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

SubPropertiesDoNotAffectRender

Se aplica a