FixedPage.Background 속성

정의

페이지 배경을 렌더링하는 데 사용되는 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

속성 값

Brush

페이지 배경을 렌더링하는 데 사용할 브러시입니다.

예제

다음 예제에서는 사용 된 Background 속성입니다.

// ----------------------- 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()

설명

종속성 속성 정보

식별자 필드 BackgroundProperty
메타 데이터 속성 설정 true AffectsRender, SubPropertiesDoNotAffectRender

적용 대상

추가 정보