How to check the working platform in Portable Class Library?

We created a single portable class library (PCL) that contains WinRT and Windows Phone code, is there a way to detect that the code works in a device (WP) or (tablet or desktop).

Note. We cannot add a condition compilation symbol because the same class library is used for both platforms.

+4
source share
1 answer

After some searching, I found one of the useful Windows.Security namespace that solves my problem.

Link: http://msdn.microsoft.com/en-us/library/windows/apps/windows.security.exchangeactivesyncprovisioning.easclientdeviceinformation

OperatingSystem, , . , "Windows", , "Windows Phone".

+2

Source: https://habr.com/ru/post/1541993/


All Articles