4
votes

We have created Single Portable Class Library(PCL) that contain WinRT and Windows Phone code,is there any way to find code is running in device(WP) or (Tablet or Desktop).

Note:We can't able to add condition compilation symbol because we are using single class library for both Platforms.

1

1 Answers

2
votes

After some search i found one of the useful namespace Windows.Security that solves my problem.

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

OpertingSystem property present in that class return correct details.If the app is running in Desktop it return "Windows" if it phone means it return "Windows Phone".