Windows Phone: updating your app's tile, simply (needed for DVLUP!)
Mood: cheerful
Posted on 2012-12-08 23:54:00
Tags: windowsphone wpdev
Words: 343
Windows Phone Live Tiles are great, but setting up push notifications is a lot of work, and even running a background agent comes with limitations. There are two easier ways to update your live tile:
- One way is to just update it when the app runs. This is not as appealing to the user as one that updates in the background, but for some apps it might be good enough. For example, I'm going to do this in my Marriage Map app, as the data doesn't change very often.
To do this, here's some sample code:
var tileEnum = ShellTile.ActiveTiles.GetEnumerator();
tileEnum.MoveNext();
var tile = tileEnum.Current;
#if WP8
FlipTileData ftd = new FlipTileData();
#else
StandardTileData ftd = new StandardTileData();
#endif
// This next part is app dependent
ftd.BackContent = "back of a medium tile";
#if WP8
ftd.WideBackContent = "back of a wide tile";
#endif
tile.Update(ftd);
Include all 3 sizes of Live Tiles (must animate between at least 2 frames within the tile space with data, images, or text).so if you want to earn rewards during Pointstravaganza, you'll need to do something to make your tiles live!
This backup was done by LJBackup.