FlowDocument.Background Eigenschaft

Definition

Ruft den Brush ab, mit dem der Hintergrund des Inhaltsbereichs gefüllt wird, oder legt diesen Pinsel fest.

public:
 property System::Windows::Media::Brush ^ Background { System::Windows::Media::Brush ^ get(); void set(System::Windows::Media::Brush ^ value); };
public System.Windows.Media.Brush Background { get; set; }
member this.Background : System.Windows.Media.Brush with get, set
Public Property Background As Brush

Eigenschaftswert

Der Pinsel, mit dem der Hintergrund des Inhaltsbereichs gefüllt wird, oder null, wenn kein Pinsel für den Hintergrund verwendet werden soll. Der Standardwert ist null.

Beispiele

Das folgende Beispiel zeigt, wie das Background 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 Sie die Background-Eigenschaft programmatisch einstellen können.

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 Farbfeldern, die die verfügbaren vordefinierten Pinselfarben anzeigen, finden Sie unter Brushes.

Informationen zur Abhängigkeitseigenschaft

Bezeichnerfeld BackgroundProperty
Metadateneigenschaften auf true festgelegt AffectsRender

Gilt für: