none
[UWP] UserControl.Background seems to doesnt work RRS feed

  • Question

  • I try to set user control background as red, but it seems doesn't work.

    I tried to do it in XAML and in code behind.

    How to fix such problem?

    Friday, February 23, 2018 9:37 PM

Answers

  • <Grid x:Name=MainGrid BackGround="Red">
       'Your Content ...
    </Grid>


    I may be new but I've been new for a long time!

    • Marked as answer by BitSmithy Tuesday, March 20, 2018 1:18 PM
    Sunday, February 25, 2018 1:16 AM
  • I read anywhere, (I dont remember where) that BackGround property for UserControl doesn't work.

    Background of the user control can be changed by its root element for example root grid.

    • Marked as answer by BitSmithy Tuesday, March 20, 2018 1:20 PM
    Tuesday, March 20, 2018 1:20 PM

All replies

  • Please see Guide to posting: subject line tags. Also please provide the relevant XAML and code-behind.


    Sam Hobbs
    SimpleSamples.Info

    Friday, February 23, 2018 9:49 PM
  • <Grid x:Name=MainGrid BackGround="Red">
       'Your Content ...
    </Grid>


    I may be new but I've been new for a long time!

    • Marked as answer by BitSmithy Tuesday, March 20, 2018 1:18 PM
    Sunday, February 25, 2018 1:16 AM
  • @BitSmithy,

    Any updates? Have you solved your problem?

    Please feel free to contact us if you have problems.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 1, 2018 2:35 AM
    Moderator
  • I read anywhere, (I dont remember where) that BackGround property for UserControl doesn't work.

    Background of the user control can be changed by its root element for example root grid.

    • Marked as answer by BitSmithy Tuesday, March 20, 2018 1:20 PM
    Tuesday, March 20, 2018 1:20 PM