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

后端 未结 2 673
臣服心动
臣服心动 2021-01-26 15:55

In iOS I have 5 application which use same code. I was able to refer the common classes and separate the application name, theme and color using the values from the Prefix.pch f

2条回答
  •  南方客
    南方客 (楼主)
    2021-01-26 16:30

    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)

提交回复
热议问题