none
[UWP] ApplicationPageBackgroundThemeBrush is always white? RRS feed

  • Question

  • Hi Guys,

    Quick question. I am just starting out with UWP apps. I was playing around in the Windows Mobile emulator, and I am noticing that ApplicationPageBackgroundThemeBrush is not being honored in my app.

    I started a new Universal App in Visual Studio, set the main grid's background to be as follows.

     <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    set my emulator mode to be dark, and launched the app from visual studio. the app's page background appears white, not black as desired.

    Is there anything else I need to be doing?



    • Edited by Tariq Ayad Saturday, February 20, 2016 11:34 PM
    Saturday, February 20, 2016 11:33 PM

Answers

  • Hello Tariq Ayad,

    I was able to reproduce the issue.

    When set the color mode to dark and see the color in Live Visual Tree it gives me background as solid color. But I think that Color Mode Dark and Light is different from Requested Theme. If you change the Requested theme to dark in app.xaml then it shows correctly.

    With Regards,

    Krunal Parekh


    Thanks MSDN Community Support Please remember to Mark as Answer the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Tariq Ayad Sunday, February 21, 2016 7:56 AM
    Sunday, February 21, 2016 4:22 AM

All replies

  • Hello Tariq Ayad,

    I was able to reproduce the issue.

    When set the color mode to dark and see the color in Live Visual Tree it gives me background as solid color. But I think that Color Mode Dark and Light is different from Requested Theme. If you change the Requested theme to dark in app.xaml then it shows correctly.

    With Regards,

    Krunal Parekh


    Thanks MSDN Community Support Please remember to Mark as Answer the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Tariq Ayad Sunday, February 21, 2016 7:56 AM
    Sunday, February 21, 2016 4:22 AM
  • Hi Krunal,

    You are right.

    The app.xaml by default has RequestedTheme="Light", which is why I wasn't seeing my mode changes applying.

    Until you told me this, I wouldn't have figured it out. Can you make sure that Microsoft gets this feedback.

    Thanks

    Tariq

    Sunday, February 21, 2016 7:56 AM
  • Krunal

    Thank you. With your help I also fixed the problem by removing RequestTheme="Light" from app.xaml. Microsoft should remove this line from the template. It wasted me 2 hours.

    Thursday, March 24, 2016 9:06 PM