Partager via


FlowDocument.Foreground Propriété

Définition

Obtient ou définit la Brush valeur à appliquer au contenu du texte du 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

Valeur de propriété

Pinceau utilisé pour s’appliquer au contenu du texte. La valeur par défaut est Black.

Exemples

L’exemple suivant montre comment définir l’attribut Foreground d’un FlowDocument élément.

<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>

L’exemple suivant montre comment définir la Foreground propriété par programmation.

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

Remarques

Pour obtenir une table de nuances qui affiche les couleurs de pinceau prédéfinies disponibles, consultez Brushes.

Tous les Foreground paramètres des éléments enfants remplacent ce paramètre de niveau supérieur.

Informations sur les propriétés de dépendance

Élément Valeur
Champ d’identificateur ForegroundProperty
Propriétés de métadonnées définies sur true AffectsRender, , Inherits

SubPropertiesDoNotAffectRender

S’applique à