FlowDocument.Background Tulajdonság

Definíció

Lekéri vagy beállítja a Brush tartalomterület hátterének kitöltéséhez használt elemet.

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

Tulajdonság értéke

A tartalomterület hátterének kitöltéséhez vagy null háttérkefe használatának hiányához használt ecset. Az alapértelmezett érték a null.

Példák

Az alábbi példa bemutatja, hogyan állíthatja be egy BackgroundFlowDocument 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 Background 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.

Függőségi tulajdonság adatai

Termék Érték
Azonosító mező BackgroundProperty
Metaadat-tulajdonságok beállítása: true AffectsRender

A következőre érvényes: