FlowDocument.Background Propriedade

Definição

Obtém ou define o Brush que é usado para preencher o fundo da área de conteúdo.

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

Valor de Propriedade

O pincel usado para preencher o fundo da área de conteúdo, ou null para não usar o pincel de fundo. A predefinição é null.

Exemplos

O exemplo seguinte mostra como definir o Background atributo de um 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>

O exemplo a seguir mostra como definir a propriedade Background programaticamente.

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

Observações

Para uma tabela de amostras que mostram as cores de pincel predefinidas disponíveis, veja Brushes.

Informação de Propriedade de Dependência

Item Value
Campo identificador BackgroundProperty
Propriedades dos metadados definidas como true AffectsRender

Aplica-se a