Reputation: 127
How can I check which platform (Windows / Windows Phone) my app is running?
Upvotes: 2
Views: 1709
Reputation: 397
VersionInfo | versionInfo property should helps to check the platform information.
var str = Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily;
if (str == "Windows.Desktop")
{
//...
}
else if (str == "Windows.Mobile")
{
//...
}
Upvotes: 6
Reputation: 128
Yes, you can use the compiler directives
#if WINDOWS_PHONE
//some code
#endif
#if WINDOWS
//some code
#endif
Upvotes: 2