How to use Prefix.pch in WP8 like in iOS?

☆樱花仙子☆ 提交于 2019-12-02 07:45:20

Just replace

#define APPLICATION_NAME @"Application01" by #define APPLICATION_NAME_Application01

and

#if APPPLICATION_THEME = @"Brown" by #if APPPLICATION_THEME_Brown

additional the instead of #define you can just set it in the project properties in the menu Build->Conditional compilation Symbols: and just put APPLICATION_NAME_Application01

C# language supports defines which can be defined either globally in the project file or you can define them on top of any file:

#define USE_BROWN_THEME

However, using application name is set in the WMAppManifest.xml file and you can only check/read it at runtime, you cannot do that at compile time. And xml files don't play well with #defines.

#define (C# Reference)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!