Subscribe to the RSS feed then follow me on twitter at @mrlacey

Wednesday, November 13, 2013

Stopping a live tile from flipping

Sometimes you may want to remove the contents (and images) from the back of a [flip] tile to stop it flipping. How to do this isn't always obvious and it can be frustrating to discover that just setting the content to an empty string or null doesn't work.
To stop a tile from flipping you must clear it’s content, not just set it to an empty string.

Unfortunately the FlipTileData class doesn't provide a method or property to make this easy. Instead you must use an XML document that contains appropriate FlipTileDate template information.
Something like this:

var clearTileBackXml = new StringBuilder();

clearTileBackXml.Append("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
clearTileBackXml.Append("");
clearTileBackXml.Append("");
clearTileBackXml.Append("");
clearTileBackXml.Append("");
clearTileBackXml.Append("");
clearTileBackXml.Append("");
clearTileBackXml.Append("");
clearTileBackXml.Append("");

var ftd = new FlipTileData(clearTileBackXml.ToString());

ShellTile.ActiveTiles.First().Update(ftd);

If you’re updating anything other than the primary tile you need to set the Tile ID in the XML as well as select the correct element from the ActiveTiles collection.

For more info and to see the full template go to MSDN.


If you've built Windows Phone or Windows Store apps you can cross-promote them with AdDuplex to get more users.

3 comments:

  1. If you have problems copying the code from here try http://developer.nokia.com/Community/Wiki/How_to_stop_a_live_tile_from_flipping#Solution instead

    ReplyDelete
  2. In line Coach Outlet Online is bringing Michael Kors Outlet unique Coach Factory Outlet to a Toms Shoes USA shoe for Cheap Jerseys Spring/Michael Kors Outlet 2014 Coach Factory Outlet, and this Coach Outlet, it's a Coach Outlet. The Coach Outlet Sale Sandal Giuseppe Zanotti Outlet.Supermodel mom Coach Factory Outlet was Coach Factory Outlet Online being all kinds of hot this weekend Coach Factory Outlet she Coach Store Online out in a Michael Kors Outlet-turning, Celine Outlet I did, I was Celine Bags possessed by Fitflops Flipflops suit madness.Fitflops USA-there string Michael Kors during Michael Kors Store vacation in Tomss Hoes Bahamas. Fitflop Footwear by her family, the 40-year-old looked happy and relaxed - Fitflops Outlet, uh, did we Fitflops Sandals super hot? - as she Giuseppe Zanotti by the pool.I've Giuseppe Zanotti Designer making my own vanilla extract for years. I love it! It's cost-effective, and in my opinion, Vanilla extract is also (easily) the most used extract in my Prada Outlet , sort of pretty (although it kind of looks like spiders too) tastes way better than imitation vanilla extract.

    ReplyDelete