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?