Search code examples
c#silverlightwindows-phone-7silverlight-4.0silverlight-3.0

How can I get a screen resolution of Device (Windows Phone)


How can I get a screen resolution of Device from settings (Windows Phone) ?


Solution

  • public void GetScreenResolution()  
    {  
         string ScreenWidth = Application.Current.Host.Content.ActualWidth.ToString();  
         string ScreenHeight = Application.Current.Host.Content.ActualHeight.ToString();  
         MessageBox.Show(ScreenWidth + "*" + ScreenHeight);  
    }