I am beginner. I have below simplest code:
<Page
x:Class="ClientFramework.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ClientFramework"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
</Grid>
</Page>
I test it in Windows mobile 10 emulator. No matter how I change OS theme, dark or light, my app's background is always white. So what is correct way to set theme-dependent app-wide colours?
I eventually find out the problem by googling about. The problem is caused by the VS2015 project template. In app.xaml, there is a line to set RequestedTheme="Light". I removed the line and things are fine now. Wasted me 2 hours. Hope you see my answer and therefore save time.
https://social.msdn.microsoft.com/Forums/vstudio/en-US/c12cdba4-093f-474a-9d21-6e447aaa2adf/uwp-applicationpagebackgroundthemebrush-is-always-white?forum=wpdevelop
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With