I think the problem you are facing is that the default page style overrides your attempt to set the background color.
If you look at the StandardStyles.xaml file, it includes LayoutRootStyle (at the very end of the file). If you change the default value to a hex color value (for example, # FFFF0000 will give you a red color), the application background will be changed accordingly. This is an easy way to do what you want, but it may not be best practice.
<Style x:Key="LayoutRootStyle" TargetType="Panel"> <Setter Property="Background" Value="{StaticResource ApplicationPageBackgroundThemeBrush}"/> <Setter Property="ChildrenTransitions"> <Setter.Value> <TransitionCollection> <EntranceThemeTransition/> </TransitionCollection> </Setter.Value> </Setter> </Style>
Alternatively, you can set the background for the Grid root element, which will give you more detailed control. Or you can create your own style that overrides LayoutRootStyle in the page section of the .Resources page by copying the rule into this section and then changing the value of the Set Background parameter.
Here's how it should look:
<Page.Resources> <Style x:Key="LayoutRootStyle" TargetType="Panel"> <Setter Property="Background" Value="#FFFF0000"/> <Setter Property="ChildrenTransitions"> <Setter.Value> <TransitionCollection> <EntranceThemeTransition/> </TransitionCollection> </Setter.Value> </Setter> </Style> </Page.Resources>
Hope this helps.
source share