I have an application for Windows Phone 7. I have created visual studio 2012 in windows 8 desktop. I am trying to use the application in Windows Phone 8 device also with some changes involved. How can I programmatically detect whether the device is Windows Phone 7 or Windows Phone 8?
Just as you would on any other platform with C#: Environment.OSVersion
You can use this toolkit to check the version of the phone: http://mangopollo.codeplex.com/
bool IsWP8() : Returns if the phone running the application is a Windows Phone 8
EDIT: If you don't want to use the whole toolkit here is how it checks it:
public static bool IsWP8 { get { return Environment.OSVersion.Version >= TargetedVersion; } }
private static Version TargetedVersion = new Version(8, 0);
Creds to original author.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With