How can I detect Windows 10 light/dark mode?

后端 未结 6 596
情话喂你
情话喂你 2020-12-03 15:12

I\'m using Windows.UI.ViewManagement.UISettings to get system accent color but it seems this class does not have any method or property for light/dark mode. I f

6条回答
  •  无人及你
    2020-12-03 15:52

    ThemeResources have been introduced in 8.1 and their behavior is similar in W10. Therefore you can define suitable resource in ThemeDictionaries responsible for available Themes and then you can check the defined resource when you whant to know which Theme is currently used.

    The code will be very similar to the one in this answer.

提交回复
热议问题