welcome to Qijie's Blog 薛其杰

For Windows Phone Apps, if you have to get the windows size, first you have to wait for the page being loaded completed, then you can get the window size by Application.Current.RootVisual.RenderSize;

 

Best Practise:

In Page Constructor, add event like below:

 this.Loaded += MainPage_Loaded;

Then in MainPage_Loaded method, get the window size, then adjust your controls ' size there.

            Size windowSize = Application.Current.RootVisual.RenderSize;
            double windowWidth = windowSize.Width;
            double windowHeight = windowSize.Height;

 

 

posted on 2013-04-01 17:09  零点零一  阅读(163)  评论(0编辑  收藏  举报