locked
RTM Known Issue: SecondaryTile BackgroundColor getter returns incorrect color RRS feed

  • Question

  • Retrieving a secondary tile's background color (via VisualElements.BackgroundColor) returns a random incorrect color (usually returns #7FFFFFFF) instead of returning the actual color that the tile was set to.

    Pinning works fine, the tile appears with the correct color...

    // Create a new secondary tile
    SecondaryTile tile = new SecondaryTile(...);
    
    // Set background color to #FF1E30D4
    tile.VisualElements.BackgroundColor = Color.FromArgb(255, 30, 48, 212);
    
    // Pin the tile
    await tile.RequestCreateAsync();
    
    // RESULT: Tile successfully pinned, correct background color appears

    However, retrieving the background color doesn't work

    // Retrieve the tile
    SecondaryTile tile = (await SecondaryTile.FindAllAsync()).First(i => i.TileId.Equals("myTile"));
    
    // And get the background color
    Color color = tile.VisualElements.BackgroundColor;
    
    // BUG: Retrieved color is #7FFFFFFF, not what we set


    Friday, September 4, 2015 10:30 PM
    Moderator

Answers

  • Status: Fixed for TH2 (fixed in build 10567)

    Workaround: There is no simple workaround. If you depend on retrieving the background color of your secondary tiles, we would recommend storing the background color in your app's own data when you pin the tile (your app is setting the background color, thus your app knows the background color).

    It's important to note that setting the background color works fine. It's only retrieving the background color that is broken. So you can still pin a secondary tile with a custom color and it'll appear correctly!




    Friday, September 4, 2015 10:36 PM
    Moderator