FlowDocument.Foreground Vlastnost

Definice

Získá nebo nastaví Brush použít pro textový obsah .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

Hodnota vlastnosti

Brush

Štětec použitý k použití na textový obsah. Výchozí formát je Black.

Příklady

Následující příklad ukazuje, jak nastavit Foreground atribut elementu FlowDocument .

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

Následující příklad ukazuje, jak nastavit Foreground vlastnost programově.

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

Poznámky

Tabulka vzorníků s dostupnými předdefinovanými barvami štětce najdete v tématu Brushes.

Všechna Foreground nastavení podřízených prvků přepíší toto nastavení nejvyšší úrovně.

Informace o vlastnosti závislosti

Pole identifikátoru ForegroundProperty
Vlastnosti metadat nastavené na true AffectsRender, Inherits,

SubPropertiesDoNotAffectRender

Platí pro