FlowDocument.Foreground Właściwość

Definicja

Pobiera lub ustawia element Brush do zastosowania do zawartości tekstowej obiektu 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

Wartość właściwości

Brush

Pędzel używany do zastosowania do zawartości tekstowej. Wartość domyślna to Black.

Przykłady

W poniższym przykładzie pokazano, jak ustawić Foreground atrybut FlowDocument elementu.

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

W poniższym przykładzie pokazano, jak programowo ustawić Foreground właściwość.

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

Uwagi

Aby uzyskać tabelę próbek pokazującą dostępne wstępnie zdefiniowane kolory pędzla, zobacz Brushes.

Wszystkie Foreground ustawienia elementów podrzędnych zastępują to ustawienie najwyższego poziomu.

Informacje dotyczące właściwości zależności

Pole identyfikatora ForegroundProperty
Właściwości metadanych ustawione na true AffectsRender, Inherits,

SubPropertiesDoNotAffectRender

Dotyczy