Search code examples
.netwindows-8windows-phone-8conditional-compilation

If NETFX_CORE is for Windows 8, what is for Windows Phone 8?


I understand using the NETFX_CORE directive, like this:

#if NETFX_CORE 
    // Windows 8
#else 
    // Windows Phone 8
#endif

More info: http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj714084(v=vs.105).aspx

But is there a directive specific to Windows Phone 8?


Solution

  • Yes, the Windows Phone directive is:

    #if WINDOWS_PHONE
    

    This is documented here, but I'm surprised that it isn't mentioned here. I also tested this in some code, and it works.