In .NET 4.5, I can use:
SystemParameters.StaticPropertyChanged += SystemParameters_StaticPropertyChanged;
but this is not supported in .NET 4.0. However, SystemParameters does give access to the HighContrast value and HighContrastKey ResourceKey. How can I monitor the value of the ResourceKey for changes so that I can mimic the PropertyChanged event? I know that a DynamicResource in XAML can do this, but this needs to be done in code behind.
Is it possible to detect changes in a ResourceKey value using just C# and not XAML?
Update The reason I cannot use .NET 4.5 is that (1) XP is not supported, and (2) my installer insists that he needs to detect and install 4.5.2 (not 4.5 or 4.51) which means all OSs must install .NET. Ugh.