FixedPage.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 for rendering the page background.
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 for rendering the page background.
Examples
The following example shows use of the Background property.
// ----------------------- CreateFirstFixedPage -----------------------
/// <summary>
/// Creates the FixedPage for the first page.</summary>
/// <returns>
/// The FixedPage for the first page.</returns>
private FixedPage CreateFirstFixedPage()
{
FixedPage fixedPage = new FixedPage();
fixedPage.Background = Brushes.LightYellow;
UIElement visual = CreateFirstVisual(false);
FixedPage.SetLeft(visual, 0);
FixedPage.SetTop(visual, 0);
double pageWidth = 96 * 8.5;
double pageHeight = 96 * 11;
fixedPage.Width = pageWidth;
fixedPage.Height = pageHeight;
fixedPage.Children.Add((UIElement)visual);
Size sz = new Size(8.5 * 96, 11 * 96);
fixedPage.Measure(sz);
fixedPage.Arrange(new Rect(new Point(), sz));
fixedPage.UpdateLayout();
return fixedPage;
}// end:CreateFirstFixedPage()
' ----------------------- CreateFirstFixedPage -----------------------
''' <summary>
''' Creates the FixedPage for the first page.</summary>
''' <returns>
''' The FixedPage for the first page.</returns>
Private Function CreateFirstFixedPage() As FixedPage
Dim fixedPage As New FixedPage()
fixedPage.Background = Brushes.LightYellow
Dim visual As UIElement = CreateFirstVisual(False)
FixedPage.SetLeft(visual, 0)
FixedPage.SetTop(visual, 0)
Dim pageWidth As Double = 96 * 8.5
Dim pageHeight As Double = 96 * 11
fixedPage.Width = pageWidth
fixedPage.Height = pageHeight
fixedPage.Children.Add(CType(visual, UIElement))
Dim sz As New Size(8.5 * 96, 11 * 96)
fixedPage.Measure(sz)
fixedPage.Arrange(New Rect(New Point(), sz))
fixedPage.UpdateLayout()
Return fixedPage
End Function ' end:CreateFirstFixedPage()
Remarks
Dependency Property Information
Item | Value |
---|---|
Identifier field | BackgroundProperty |
Metadata properties set to true |
AffectsRender, SubPropertiesDoNotAffectRender |
Applies to
See also
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET