Detect system theme change in WPF

后端 未结 3 1917
悲哀的现实
悲哀的现实 2020-12-03 12:57

I need, for my WPF app, to detect when the DWM is turned on/off or when the system theme changes.
There is such an event in WinForms, but I can\'t see any in WPF.

3条回答
  •  春和景丽
    2020-12-03 13:32

    The event SystemEvents.UserPreferenceChanged also does the trick. UserPreferenceChanged(in Japaense)

提交回复
热议问题