using System; using Microsoft.Phone.Shell; namespace Juick.Classes { static class TileHelper { public static void UpdateFlipTile( string title, string backTitle, string backContent, string wideBackContent, int? count, string smallBackgroundImageStringUri, string backgroundImageStringUri, string backBackgroundImageStringUri, string wideBackgroundImageStringUri, string wideBackBackgroundImageStringUri) { var smallBackgroundImage = CreateRelativeUri(smallBackgroundImageStringUri); var backgroundImage = CreateRelativeUri(backgroundImageStringUri); var backBackgroundImage = CreateRelativeUri(backBackgroundImageStringUri); var wideBackgroundImage = CreateRelativeUri(wideBackgroundImageStringUri); var wideBackBackgroundImage = CreateRelativeUri(wideBackBackgroundImageStringUri); // Loop through any existing Tiles that are pinned to Start. foreach (var tileToUpdate in ShellTile.ActiveTiles) { var updateTileData = new FlipTileData { Title = title, Count = count, BackTitle = backTitle, BackContent = backContent, SmallBackgroundImage = smallBackgroundImage, BackgroundImage = backgroundImage, BackBackgroundImage = backBackgroundImage, WideBackgroundImage = wideBackgroundImage, WideBackBackgroundImage = wideBackBackgroundImage, WideBackContent = wideBackContent }; tileToUpdate.Update(updateTileData); } } static Uri CreateRelativeUri(string uriString) { return !string.IsNullOrEmpty(uriString) ? new Uri(uriString, UriKind.Relative) : null; } } }