In the main grid, the Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
and if I change the theme in the constructor, the colors change there too. But when I launch the application, which is on a real device in the emulator, the theme of the application is always bright, although I put a dark theme.
|
1 answer
The application theme is specified in the App.xaml file, not in the XAML constructor.
<Application x:Class="MyApp1.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" RequestedTheme="Dark">
Pay attention to the RequestedTheme="Dark"
property RequestedTheme="Dark"
. The same property exists on other controls. Make sure that the desired topic is specified in App.xaml, and that the other elements do not override this property to another topic.
|