I am using a Xamarin solution (VS2015), with shared code then a separate project for UWP, IOS and Android.
In the shared project, how do I change which code is greyed out when using #if
?
e.g:
#if (WINDOWS_PHONE || WINDOWS_UWP || WINDOWS_APP)
StorageFolder storageFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
StorageFile sampleFile = await storageFolder.GetFileAsync(fileName);
string text = await FileIO.ReadTextAsync(sampleFile);
return text;
#elif (__IOS__ || __ANDROID__)
var documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
var filePath = Path.Combine(documentsPath, fileName);
return await Task.Run(() => File.ReadAllText(filePath));
#endif
Currently the __ANDROID__
section is being colourised by VS, and the WINDOWS_PHONE part is greyed out. How can I tell VS that I want it the other way around?
Drop down this box and select the appropriate project to run, in your case, the UWP project