FlowDocument.Background Właściwość

Definicja

Pobiera lub ustawia Brush użyte do wypełnienia tła obszaru zawartości.

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

Wartość właściwości

Szczotka używana do wypełniania tła obszaru zawartości lub null nie używa pędzla tła. Wartość domyślna to null.

Przykłady

W poniższym przykładzie pokazano, jak ustawić Background 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ć Background 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, które pokazują dostępne wstępnie zdefiniowane kolory pędzla, zobacz Brushes.

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

Pole identyfikatora BackgroundProperty
Właściwości metadanych ustawione na true AffectsRender

Dotyczy