Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"

Neo 421 Reputation points
2024-02-16T15:53:34.36+00:00

What is the purpose of this property? It seems I can remove it without any problems when runing an UWP app.

Universal Windows Platform (UWP)
{count} votes

1 answer

Sort by: Most helpful
  1. Roy Li - MSFT 32,111 Reputation points Microsoft Vendor
    2024-02-19T03:32:47.2866667+00:00

    Hello,

    Welcome to Microsoft Q&A!

    This property is used to define the background color of the Page. The ApplicationPageBackgroundThemeBrush is White in default mode and light mode. ApplicationPageBackgroundThemeBrush will use Black in dark Mode. You could try to set the RequestedTheme property of the Page to Dark and you will see the Page's background changes to Black.

    The default value of the Background property is Transparent. So when your app is in default mode or light mode, it looks like there is no difference when you delete it. When you are in the dark mode, you will still get white background when you delete it.

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.