WP8 should use custom conditional compilation flags provided by the developer. Read more about this exact topic here . Nokia has an entire article on coding for both WP7 and WP8 , and I highly recommend that you list all the methods to see which one is the best for you.
Definition of a conditional compilation symbol:
- Right-click the WP 8 project and select Properties. Open
- Create a Design Project page and insert WP8 into the Conditional compilation symbols. After that they should contain something like this: SILVERLIGHT; WINDOWS_PHONE; WP8
And here is an example of inline code
// Separate implementations for different OS versions #if WP8 // code using enhancements introduced in Windows Phone 8 #else // code using Windows Phone OS 7.1 features #endif // A new Windows Phone 8 feature #if WP8 // code using new Windows Phone 8 feature #endif
source share