Displaying the Saved Pictures in the Windows Phone 8 emulator

One cool feature of the Windows Phone emulator is that it allows you to select pictures from your app (using the PhotoChooserTask) without having to try your app on a physical device. For example, this code (which I used in some of my recent presentations) will trigger the Photo Chooser UI to be displayed on the emulator too:

private Action<IEnumerable<IImageFileInfo>> _callback;
        
public void SelectFiles(Action<IEnumerable<IImageFileInfo>> callback)
{
    var task = new PhotoChooserTask
    {
        ShowCamera = true
    };

    task.Completed += TaskCompleted;
            
    _callback = callback;
    task.Show();
}

void TaskCompleted(object sender, PhotoResult e)
{
    if (e.Error == null
        && e.ChosenPhoto != null
        && _callback != null)
    {
        var fileName = e.OriginalFileName
            .Substring(e.OriginalFileName.LastIndexOf("\\") + 1);

        var info = new FileViewModel(e.ChosenPhoto, fileName);
        var infos = new List<IImageFileInfo>
        {
            info
        };

        _callback(infos);
    }
}

In Windows Phone 8 however, when you execute this code, you will be shown an almost empty Photo Chooser UI:

Missing Saved Pictures

Notice that the “Saved Pictures” album is missing. At first I thought it was just not there at all, but you can actually restore it with the following steps:

  • Press on the Windows button
  • On the main screen, press on Photos
  • Press on Albums
  • Open the so called “8” photo album
  • Press Back until you are back into your app and try again.

This time you will see the saved pictures, and can perform your tests in more realistic conditions!

Restored Saved Pictures

Happy coding!
Laurent

 

Print | posted on Sunday, November 18, 2012 3:50 PM

Feedback

# Beware Microsoft's Buy New Computer Upgrade to Win8 Pro Scam

left by C Gallagher @virtualCableTV at 11/18/2012 11:09 PM Gravatar
Microsoft is scamming developers with their "buy a new computer and upgrade to Windows 8 Pro for $14.95" without fair advisory to developers.

Windows Phone 8 emulator requires hardware virtualization in BIOS which most Windows 7 machines being sold do not support and is actually impossible to learn about until after the sale is made.

Furthermore, the people Microsoft are ripping off this time cannot download the upgrade -- they have to install the upgrade over the WWW directly onto the "new" machine so there is no way to reinstall a failed upgrade that I have observed.

# re: Displaying the Saved Pictures in the Windows Phone 8 emulator

left by Laurent at 11/20/2012 4:17 PM Gravatar
I am sorry you feel scammed (though really, 15 bucks, dude...) but the fact that Windows Phone 8 development needs SLAT is published at http://www.microsoft.com/en-us/download/details.aspx?id=35471 and really everyone can see that. Anyway I am not quite sure what this has to do with this post.
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: