FlowDocument.Background 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定 Brush 用來填充內容區域的背景。
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
屬性值
刷子用來填滿內容區的背景,或 null 是不使用背景刷子。 預設值為 null。
範例
以下範例說明如何設定 Background 元素 FlowDocument 的屬性。
<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>
下列示範如何以程式設計的方式設定 Typography 屬性。
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
備註
關於顯示可用預設畫筆顏色的色片表,請參見 Brushes。
相依財產資訊
| 項目 | 價值 |
|---|---|
| 識別碼欄位 | BackgroundProperty |
元資料屬性設為 true |
AffectsRender |