0

Article: http://developer.nokia.com/resources/library/Lumia/optimising-for-large-screen-phones/resolution-specific-considerations.html

I want to use the ResolutionHelper class that is described in the article to detect the resolution of a Windows Phone device/emulator, but I always get the following error message in this line:

_size = (Size)DeviceExtendedProperties.GetValue("PhysicalScreenResolution");

The name 'DeviceExtendedProperties' does not exist in the current context

In addition, I don't know how to use the class. I tried to call it like this, but I get an error message:

Resolutions currentRes = ResolutionHelper.CurrentResolution(); 

Non-invocable member 'GameName1.ResolutionHelper.CurrentResolution' cannot be used like a method.

What is wrong? How can I use the class?

UPDATE: I get a new error message in this line:

return App.Current.Host.Content.ScaleFactor == 100;

An exception of type 'System.UnauthorizedAccessException' occurred in System.Windows.ni.dll but was not handled in user code

Additional information: Invalid cross-thread access.

What is wrong?

Leo
  • 267
  • 1
  • 4
  • 14
  • Drop the brackets on `ResolutionHelper.CurrentResolution`. It's a property, not a method. – ChristopheD May 10 '14 at 08:36
  • That fixed this error message. But now I get new error message: An exception of type 'System.UnauthorizedAccessException' occurred in System.Windows.ni.dll but was not handled in user code Additional information: Invalid cross-thread access. – Leo May 10 '14 at 10:17

0 Answers0