I am wirking on windows phone 8.1 RT application. And i can't find a way to update background of application main tile. code like this works only for secondary tiles:
foreach (SecondaryTile tile in await SecondaryTile.FindAllAsync())
{
tile.BackgroundColor = Colors.Aqua;
tile.UpdateAsync();
}
I can get access to main tile only this way:
var updatile = TileUpdateManager.CreateTileUpdaterForApplication();
var tileNotification = new TileNotification(tileXml);
updatile.Update(tileNotification);
But i don't know how to change tile background this way.
Could you help me, please?
I'm afraid that you'll not be able to change the application tile's background color as you have requested, but where as you can include an image to the tile:
var tileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare150x150PeekImageAndText01);
var tileImage = tileXml.GetElementsByTagName("image")[0] as XmlElement;
tileImage.SetAttribute("src", "ms-appx:///Assets/bild.JPG");
var tileText = tileXml.GetElementsByTagName("text");
var tileNotification = new TileNotification(tileXml);
TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification);
Reference: Live Tiles for WP8.1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With