How to get current Windows 10 Theme?

In the namespace Windows.UI.ViewManagement, you can Access to the UISettings class. It will allow you to get the Window background and deduce the current theme.

How to set the theme when multiple views are open?

You must iterate all the views via the CoreApplication. Secondly, you can go to the dispatcher of the view and set the RequestedTheme to the desired one.

How to set the theme to a ContentDialog or a control?

It is possible to set the theme manually in a control.

How to manage theme colors in the XAML?

If you want to support different theme (e.g: Light or Dark), the best way is to use Theme Resources. You can find more information about the subject here. Brush will be adapted automatically when you change the requested theme. Here is an example of XAML code.

In the following pictures you can compare the different render of the color between the theme.

Theme UWP Light base
Theme UWP Light base
Theme UWP Dark base
Theme UWP Dark base


Finally, you will notice the importance of taking into account theming at the very beginning of you implementation. Otherwise you will be forced to cleanup all your brushes and colors used in your XAML.