FlowDocument.Background Egenskap

Definition

Hämtar eller anger den Brush som används för att fylla bakgrunden i innehållsområdet.

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

Egenskapsvärde

Penseln som används för att fylla innehållets bakgrund eller null för att inte använda en bakgrundsborste. Standardvärdet är null.

Exempel

I följande exempel visas hur du anger attributet för Background ett FlowDocument element.

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

I följande exempel visas hur du ställer in Background-egenskapen programmatiskt.

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

Kommentarer

En tabell med färgrutor som visar tillgängliga fördefinierade penselfärger finns i Brushes.

Information om beroendeegenskap

Objekt Value
Identifierarfält BackgroundProperty
Metadataegenskaper inställda på true AffectsRender

Gäller för