Blog

How to Set Width of a Page in a WPF Application

Posted by Mahesh Chand Blogs | WPF Oct 07, 2011
How to Set Width of a Page in a WPF Application.

Recently, I have been working on a WPF application that has some Windows and Pages. A Page is hosted within a Windows in an XBAP application. The Width, MaxWidth and MinWidth properties do not apply to a Page. The only way you could change the width of a page is using the WindowWidth property.

The following code snippet sets a Page width.

<Page 

       WindowHeight="860"
       WindowWidth="1024"|
       Width="1200" Height="768">

 

You can also set this dynamically from the code on the class constructor or anywhere else.

public DashboardAdministrator(){

this.InitializeComponent();      

       this.WindowHeight = 860;
       this.WindowWidth = 1024; 

}


Related Readings

post comment
     
COMMENT USING
PREMIUM SPONSORS
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
Join a Chapter
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
Join a Chapter