FlowDocument.Background Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the Brush used to fill the background of content area.
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
Property Value
The brush used to fill the background of the content area, or null
to not use a background brush. The default is null
.
Examples
The following example shows how to set the Background attribute of a 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>
The following example shows how to set the Background property programmatically.
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
Remarks
For a table of swatches that show the available predefined brush colors, see Brushes.
Dependency Property Information
Item | Value |
---|---|
Identifier field | BackgroundProperty |
Metadata properties set to true |
AffectsRender |
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET