I am aware that WP7.x apps can be downloaded on WP8, but I want the app to detect the phone version while running, and provide more capabilities when installed on WP8, and limited features (due to API limitations) on a WP7.x . This would allow both (WP8 and WP7) the users to download the app, but use it with full and limited functionality respectively.
Thanks for the reply in advance.
Here is how Nokia suggests you set up your architecture for targeting both platforms:
http://www.developer.nokia.com/Resources/Library/Lumia/#!co-development-and-porting-guide.html;#toc_Portableclasslibraries
How to detect the OS version:
Detect OS version – Windows Phone 7 or Windows Phone 8?