FlowDocument.Foreground Tulajdonság

Definíció

Lekéri vagy beállítja az Brush alkalmazáshoz a szöveg tartalmát.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

Tulajdonság értéke

A szöveg tartalmára alkalmazott ecset. Az alapértelmezett érték a Black.

Példák

Az alábbi példa bemutatja, hogyan állíthatja be egy ForegroundFlowDocument elem attribútumát.

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

Az alábbi példa bemutatja, hogyan állíthatja be a Foreground tulajdonságot programozott módon.

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

Megjegyzések

A rendelkezésre álló előre definiált ecsetszíneket megjelenítő színtártáblákért lásd: Brushes.

A gyermekelemek beállításai Foreground felülbírálják ezt a legfelső szintű beállítást.

Függőségi tulajdonság adatai

Termék Érték
Azonosító mező ForegroundProperty
Metaadat-tulajdonságok beállítása: true Microsoft.Authorization/*/write, , Microsoft.Network/vpnGateways/*

SubPropertiesDoNotAffectRender

A következőre érvényes: