Q: How to Create CycleTile Dynamically in Windows Phone 8 I would like to use the new Cycle Tile feature available in Windows Phone 8, although I am having trouble creating this dynamically. My issue arises when attempting to set the images for the Cycle Tile, I do not seem to be getting the correct paths for the images. What I have so far is as follows
MainPage.xaml.cs
private void CreateApplicationTile()
    {
        //App.PictureList.Pictures grabs all of my application images from IsolatedStorage
        int count = App.PictureList.Pictures.Count();
        int count1 = count - 9;
        var cycleImages = new List<Uri>();

        if (count > 0)
        {
            //I only want to add the 9 most recent images if available
            for (int i = count; i > count1; i--)
            {
                int index = i - 1;
                if (index > -1)
                {
                    //Set file to type CapturedPicture, which contains the jpg, name, date, etc.
                    var file = App.PictureList.Pictures[index] as CapturedPicture;
                    //TilePictureRepository class saves the file (picture) to "Shared/ShellContent/"
                    //TilePictureRepository.IsolatedStoragePath = "Shared/ShellContent/"
                    TilePictureRepository.Instance.SaveToLocalStorage(file, TilePictureRepository.IsolatedStoragePath);
                }
            }
        }


        // Select the application tile 
        ShellTile myTile = ShellTile.ActiveTiles.First();

        if (myTile != null)
        {
            Uri[] u = new Uri[9];
            using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
            {
                IEnumerable<string> files = isf.GetFileNames(TilePictureRepository.IsolatedStoragePath + "*").Reverse();
                int x = 0;
                foreach (string file in files)
                {
                    if (x < 9)
                    {
                        u[x] = new Uri("isostore:/Shared/ShellContent/" + file, UriKind.Absolute);
                        cycleImages.Add(u[x]);
                        x++;
                    }
                }
            }

            CycleTileData newTileData = new CycleTileData
            {
                Title = "Tile Test",
                SmallBackgroundImage = new Uri("/Assets/Tiles/Tile_Small_159x159.png", UriKind.Relative),
                CycleImages = cycleImages,
            };

            myTile.Update(newTileData);
        }
    }

From what I understand, tile images for the Cycle Tile should be saved in the ShellTile directory within IsolatedStorage. To do this, I am using the following class which I quickly modified (I really only am using the SaveToLocalStorage method)
TilePictureRepository.cs
#region Constants

    public const string IsolatedStoragePath = "Shared/ShellContent/";

    #endregion

    #region Fields

    private readonly ObservableCollection<Picture> _pictures = new ObservableCollection<Picture>();

    #endregion

    #region Properties

    public ObservableCollection<Picture> Pictures
    {
        get { return _pictures; }
    }

    #endregion

    #region Singleton Pattern

    private TilePictureRepository()
    {
        LoadAllPicturesFromIsolatedStorage();
    }

    public static readonly TilePictureRepository Instance = new TilePictureRepository();

    #endregion

    /// <summary>        
    /// Saves to local storage
    /// This method gets two parameters: the captured picture instance and the name of the pictures folder in the isolated storage
    /// </summary>
    /// <param name="capturedPicture"></param>
    /// <param name="directory"></param>
    public void SaveToLocalStorage(CapturedPicture capturedPicture, string directory)
    {
        //call IsolatedStorageFile.GetUserStoreForApplication to get an isolated storage file
        var isoFile = IsolatedStorageFile.GetUserStoreForApplication();
        //Call the IsolatedStorageFile.EnsureDirectory extension method located in the Common IsolatedStorageFileExtensions class to confirm that the pictures folder exists.
        isoFile.EnsureDirectory(directory);

        //Combine the pictures folder and captured picture file name and use this path to create a new file 
        string filePath = Path.Combine(directory, capturedPicture.FileName);
        using (var fileStream = isoFile.CreateFile(filePath))
        {
            using (var writer = new BinaryWriter(fileStream))
            {
                capturedPicture.Serialize(writer);
            }
        }
    }

    /// <summary>
    /// To load all saved pictures and add them to the pictures list page
    /// </summary>
    public CapturedPicture LoadFromLocalStorage(string fileName, string directory)
    {
        //To open the file, add a call to the IsolatedStorageFile.GetUserStoreForApplication
        var isoFile = IsolatedStorageFile.GetUserStoreForApplication();

        //Combine the directory and file name
        string filePath = Path.Combine(directory, fileName);
        //use the path to open the picture file from the isolated storage by using the IsolatedStorageFile.OpenFile method
        using (var fileStream = isoFile.OpenFile(filePath, FileMode.Open, FileAccess.Read))
        {
            //create a BinaryReader instance for deserializing the CapturedPicture instance
            using (var reader = new BinaryReader(fileStream))
            {
                var capturedPicture = new CapturedPicture();
                //create a new instance of the type CapturedPicture called CapturedPicture.Deserialize to deserialize the captured picture and return it
                capturedPicture.Deserialize(reader);
                return capturedPicture;
            }
        }
    }

    /// <summary>
    /// To load all the pictures at start time
    /// </summary>
    private void LoadAllPicturesFromIsolatedStorage()
    {
        //add call to the IsolatedStorageFile.GetUserStoreForApplication to open an isolated storage file
        var isoFile = IsolatedStorageFile.GetUserStoreForApplication();
        //Call the IsolatedStorageFile.EnsureDirectory extension method located in the Common IsolatedStorageFileExtensions class to confirm that the pictures folder exists
        isoFile.EnsureDirectory(IsolatedStoragePath);

        //Call the IsolatedStorageFile.GetFileNames using the pictures directory and *.jpg as a filter to get all saved pictures
        var pictureFiles = isoFile.GetFileNames(Path.Combine(IsolatedStoragePath, "*.jpg"));            

        //Iterate through all the picture files in the list and load each using the LoadFromLocalStorage you created earlier
        foreach (var pictureFile in pictureFiles)
        {
            var picture = LoadFromLocalStorage(pictureFile, IsolatedStoragePath);
            _pictures.Add(picture);
        }
    }

My result is that as the smallest tile available on the start screen, I see the application tile, while the medium and large tile sizes only show a blank tile (just the accent color and application name).
