Detecting Windows Phone Screen Size

Monday, November 15, 2010 / Posted by Luke Puplett /

Eventually, and probably not long from now, the Windows Phone will have a form factor that isn’t 480 x 800 so here’s how to detect the screen size:

protected PhoneViewModel()
{
    this.ScreenWidth = System.Windows.Application.Current.Host.Content.ActualWidth;
    this.ScreenHeight = System.Windows.Application.Current.Host.Content.ActualHeight;
}

Labels: , , ,

0 comments:

Post a Comment