Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WP8.1 change application tile background [duplicate]

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?

like image 920
Ivan Chepikov Avatar asked Dec 06 '25 03:12

Ivan Chepikov


1 Answers

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

like image 92
Kulasangar Avatar answered Dec 08 '25 23:12

Kulasangar