public static void SavePicture(Grid grid, string folder, string fileName)
 {
     ExtendedImage image = grid.ToImage();
     using (System.IO.IsolatedStorage.IsolatedStorageFile file = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication())
     {
         if (!file.DirectoryExists(folder))
         {
             file.CreateDirectory(folder);
         }
         using (System.IO.IsolatedStorage.IsolatedStorageFileStream stream = file.OpenFile(fileName, System.IO.FileMode.OpenOrCreate))
         {
             image.WriteToStream(stream, fileName);
         }
     }
 }
 public static string SaveTilePicture(Grid content, string fileName)
 {
     ExtendedImage image = content.ToImage();
     fileName = "Shared/ShellContent/tiles/" + fileName;
     using (System.IO.IsolatedStorage.IsolatedStorageFile file = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication())
     {
         if (!file.DirectoryExists("Shared/ShellContent/tiles"))
         {
             file.CreateDirectory("Shared/ShellContent/tiles");
         }
         using (System.IO.IsolatedStorage.IsolatedStorageFileStream stream = file.OpenFile(fileName, System.IO.FileMode.OpenOrCreate))
         {
             image.WriteToStream(stream, fileName);
         }
     }
     return ("isostore:/" + fileName);
 }