Macros in Prefix.pch file - equivalent in WP8
Asked Answered
W

0

0

In iOS applications we use same code. I was able to refer the common classes and separate the application name, theme,color etc using the values from the Prefix.pch file.

#define APPLICATION_NAME @"ABC"
#define APPLICATION_THEME @"RED"
#define SUPPORTS_ICLOUD 0

By using these macros defined my prefix file, in my program I can say

#if SUPPORTS_ICLOUD = 0

-do this stuff-

I would like to follow the same approach in WP8.

I found that we can just set it in the project properties in the menu Build->Conditional compilation Symbols:.

But i have around 50+ macros defined and its hard to add it in Build->Conditional compilation Symbols to add and delete it.

So What is the best approach that i can follow ?

Warbeck answered 28/2, 2014 at 11:38 Comment(4)
How many targets you have? Are you creating many applications from a single template?Macpherson
@ToniPetrina many, yes i have a template and creating many applications from thatWarbeck
Since C# doesn't include files the way C++ does it, I am afraid that there is no easy way for you to do that. You will either have to create a new target with different compilation symbols or you will have to generate new .csproj files for each target.Macpherson
this is a duplicate from #21306971Distil

© 2022 - 2024 — McMap. All rights reserved.