Search code examples
c#windows-phone-8live-tile

How do you set a default tile in Windows Phone 8.0?


I have a Windows Phone 8 application that has a live tile using the FlipTileData data structure to display information in a flip tile. However, a situation can arise where no relative information can be shown in the live tile. In that situation, I'd like to revert the application tile to the default, non-live tile (that simply displays the icon and application name, like when you first pin an app to the start screen).

I can't figure out how this is done. I get the application's tile using

var tile = ShellTile.ActiveTiles.FirstOrDefault();

and then I set it to a live tile using

tile.Update(flipTileData);

However, there's no DefaultTileData structure or something like that, and you can't provide the Update() method with null. How do I essentially turn off the live tile and revert to a default tile from code?


Solution

  • You can use the FlipTileData for that scenario also. Only set the title and the images to the default app icon (usually the images in Assets\Tiles). Do not set the back content or count or anything else.