I need to subscribe to an hypothetical event that should be triggered whenever the user changes date, time, or number formats in Clock and Region settings. Below is the picture of how this settings window look in Windows 10 (I suppose that in older Win versions is pretty much the same stuff):
I have to achieve this in order to call ClearCachedData method on my CurrentCulture
.
What I have tried is to subscribe to UserPreferenceChanged event following the solution in this question. Nevertheless the event never fires...
I am using WPF although I believe this should not be relevant, although I mention it in case it is...
Further details
My application has a data grid with numeric value editors (I am using Devexpress's controls although this is may be not relevant), so, suppose I have this cell holding a value of 1.5, this will be like so due to the fact that I have set my numeric formats to an English (US) culture. Now, I go to these settings (while having my app running), and change my numeric formats to German(Germany). Then I want to update the displayed value to 1,5. This feature is already supported on Devexpress's controls and WPF in general, I just need to call ClearCachedData
and update my layout.
An already existing application that I know for sure does this is Excel (I am sure there must be a lot more), try yourself to set a float value (1.5 e.g.), and with the window opened go to change your numeric formats with a Germany region: the cell updates its displayed value to 1,6.