Condividi tramite


FlowDocument.Foreground Proprietà

Definizione

Ottiene o imposta l'oggetto Brush da applicare al contenuto di testo dell'oggetto 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

Valore della proprietà

Pennello utilizzato per applicare al contenuto del testo. Il valore predefinito è Black.

Esempio

Nell'esempio seguente viene illustrato come impostare l'attributo Foreground di un FlowDocument elemento .

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

Nell'esempio seguente viene illustrato come impostare la proprietà Foreground a livello di codice.

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

Commenti

Per una tabella di campioni che mostra i colori del pennello predefiniti disponibili, vedere Brushes.

Tutte Foreground le impostazioni sugli elementi figlio sostituiscono questa impostazione di primo livello.

Informazioni sulle proprietà di dipendenza

Elemento Valore
Campo Identificatore ForegroundProperty
Proprietà dei metadati impostate su true Microsoft.Authorization/*/write, Microsoft.Network/vpnGateways/*,

SubPropertiesDoNotAffectRender

Si applica a