I am having some issues with the MediaLibrary Favorites album on Windows Phone 7.1 Sdk. The problem is that it always returns 0 pictures even if I can see them inside pictures hub on the Favorites tab. Tried on the Emulator using Windows Phone Commands so I can Favorite a pictures and also on the device but it’s always 0. A similar problem was posted on the forum but it got never answered (at least know that this is a known bug and if there is any work around)
the code to reproduce the problem it’s pretty simple:
string message = "";
MediaLibrary ml = new MediaLibrary();
var albums = ml.RootPictureAlbum.Albums;
foreach (var album in albums)
message += album.Name + " [" + album.Pictures.Count + "]"+Environment.NewLine;
- Edited by Ardelean DanMVP Monday, September 03, 2012 8:09 PM
There is a bug report about this issue.
As I understand it, the Favorite Pictures "album" is special in that it only contains references to pictures in other albums. (... it does not actually contain any pictures itself.)
To put it a different way, if you enumerate all Pictures in the MediaLibrary, none of them would have the value: "Favorite Pictures" in their Album property.
"Favorites" are a virtual photo album, more like a "photo search folder". It's album content show all pictures that have an EXIF rating property of 75. See the explanation in onte of the later replies here: http://social.msdn.microsoft.com/forums/windowsapps/en-US/6bfbb11c-3971-4b94-a4b3-59f8310b9f69/favorite-photos-and-photo-location-or-city-name-wp-81-runtime?forum=wpdevelop
- Proposed as answer by Grille Chompa Wednesday, July 30, 2014 6:22 PM