Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect OS version - Windows Phone 7 or Windows Phone 8?

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?

like image 350
sharmila Avatar asked Nov 09 '12 04:11

sharmila


2 Answers

Just as you would on any other platform with C#: Environment.OSVersion

like image 130
Factor Mystic Avatar answered Oct 10 '22 23:10

Factor Mystic


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.

like image 31
robertk Avatar answered Oct 10 '22 23:10

robertk