Resetting the Live Tile in Windows Phone 7

The ability to update the Live Tile in Mango is a really great feature. I have an application where I’m generating dynamic images and setting the live tile to an isostore:/Shared/ShellContent url. But, I have a setting that the user can use to turn on/off live tile updates. When turning it off, I initially couldn’t figure out how to reset the tile.

The trick is to use an appdata: url to refer to your original image. For example, if your standard tile image is called “background.png”, then you can use the following to reset it:

         public static void ResetTile()
        {
            StandardTileData newTileData = new StandardTileData();
            newTileData.BackgroundImage = new Uri("appdata:background.png");

            ShellTile appTile = ShellTile.ActiveTiles.First();
            appTile.Update(newTileData);

        }

Note: If you have changed any other properties like the BackContent, you will want to reset them by setting them to “”. Passing in null will leave the values unchanged.