Universal App

Conditionally compile XAML in an Universal App

Conditional compilation feature is primarily used to include or exclude a portion of source code file based on certain condition. In a typical C# program, you can use preprocessor directives to perform conditional compilation as shown below – public double MyMethod(int input) { double result; #if CONDITION result = input * 0.5; #else result = input * 0.10; #endif return result; } If the CONDITION is set, result = input * 0.5 code will get compiled otherwise result = input * 0.10 will be compiled. Such type of conditional compilation is commonly used if you want to isolate platform specific…