0

I need to add support to a WPF application for Windows high contrast mode. What is the best way to detect high contrast mode is active, and load a specific resource dictionary (containing theme)?

Currently, the app looks the same in high contrast as normal mode.

5Flags
  • 133
  • 8

1 Answers1

2

You can combine several things to achieve that. In WPF SystemParameters.HighContrast gives you information about the High Contrast accessibility feature. You can check that value and load the necessary resource dictionaries. That will handle the startup. And you can use the approach described here, listen theme changed event, and check the SystemParameters.HighContrast if it is different then the previous load appropriate dictionaries vice versa.

Eldar
  • 9,781
  • 2
  • 10
  • 35