February 2015
Intermediate to advanced
768 pages
26h 24m
English
If your app loads external files (such as from your own Web server), then you cannot take advantage of automatic resource qualifier support. However, you can certainly mimic it in C# by inspecting the aspects of the current environment you care about. The following code demonstrates how you might fetch different files based on the current automatic scaling and contrast mode:
void LoadImage(Image image, string filename) { // Either "Scale100Percent", "Scale140Percent", or "Scale180Percent": string scale = DisplayProperties .ResolutionScale.ToString(); // Getting the current user theme is a bit more onerous: AccessibilitySettings settings = new AccessibilitySettings();
Read now
Unlock full access