I am working in windows phone 8. I am trying to save multiple images to isolated storage. But at the time of saving it's like my UI is being hanged. May be this is happening for "Deployment.Current.Dispatcher.BeginInvoke". If i don't use Deployment.Current.Dispatcher.BeginInvoke then I get an Invalid cross-thread access error at the line "var bi = new BitmapImage();".
Sample code for saving images:
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
    var workingDictionary = new Dictionary<string, Stream>(streamDictionary);
    foreach (var item in workingDictionary)
    {
       var isoStore = IsolatedStorageFile.GetUserStoreForApplication();
       if (isoStore.FileExists(item.Key))
       isoStore.DeleteFile(item.Key);
       using (var writer = new StreamWriter(new IsolatedStorageFileStream(item.Key, FileMode.Create, FileAccess.Write, isoStore)))
       {
          var encoder = new PngEncoder();
          var bi = new BitmapImage();
          bi.SetSource(item.Value);
          var wb = new WriteableBitmap(bi);
          encoder.Encode(wb.ToImage(), writer.BaseStream);
          System.Diagnostics.Debug.WriteLine("saving..." + item.Key);
       }
    }
});
Any help will be highly appreciated.