A command line utility + MSBuild Task to enable conditional compilation like directives in XAML files. Compatible Visual Studio 2010+ and Xamarin Studio.
- To mutualise UI code between Windows Phone, Windows 8 and 10 apps
- To make different versions of an application with the ease of conditional compilation directives
- Incidentally any other light XML transformations
The emulator (right) features two removed lines in the first section, and color attributes manipulations (injection, replacement and conditional injection) based on build symbols.
Using a special syntax for comment you can conditionally remove node, add or remove attribute, or remove directives. Boolean expression let you specify complex condition.
À lire absolument, car cela fait office de documentation :
Used since May 2013 to build multiple versions of my Windows Phone Japanese-French Dictionary.
The project build an executable which can be used either:
- in command line
- as a MSBuild Task
The command line syntax is:
XamlPreprocessor.exe <SYMBOL_LIST> <input_file.xml> <output_file.xml>
SYMBOL_LIST is a list of comma separated symbols (eg. DEBUG;WINDOWS_PHONE)
For the MSBuild integration, see the sub projects IntegrationDemoApp.