Freigeben über


FlowDocument.Foreground Eigenschaft

Definition

Dient zum Abrufen oder Festlegen des Brush Zuweisens auf den Textinhalt der .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

Eigenschaftswert

Der Pinsel, der zum Anwenden auf den Textinhalt verwendet wird. Der Standardwert lautet Black.

Beispiele

Das folgende Beispiel zeigt, wie das Foreground Attribut eines FlowDocument Elements festgelegt wird.

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

Das folgende Beispiel zeigt, wie die Foreground-Eigenschaft programmgesteuert festgelegt wird.

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

Hinweise

Eine Tabelle mit Farbmustern, die die verfügbaren vordefinierten Pinselfarben anzeigt, finden Sie unter Brushes.

Alle Foreground Einstellungen für untergeordnete Elemente setzen diese Einstellung auf oberster Ebene außer Kraft.

Informationen zur Abhängigkeitseigenschaft

Element Wert
Bezeichnerfeld ForegroundProperty
Auf Metadateneigenschaften festgelegt true AffectsRender, Inherits

SubPropertiesDoNotAffectRender

Gilt für: