Determine OS version in Windows Phone device

It is often useful to determine the installed OS version on user device if your app uses some functionality that is specific to a OS. Just as you would on any other platform with C#: Environment.OSVersion will return the current OS version. We use this logic to check if Windows Phone 8 GDR3 Update is installed in phone..