At this point in my WP7 development I am up to 3 apps on the marketplace with another 2 on the way, I have had a real good chance to look over the API, and the patterns you should use (MVVM). Getting to know the WP7 OS was a trivial task considering  how new it is, however, I have found one issue that, considering one of the apps I have created is really frustrating. The MartketplaceDetailTask is designed to help highlight specific applications, and according to the content type, specific marketplace songs. So this is what you get when looking for a specific app:

MarketplaceDetailTask marketDetail = new MarketplaceDetailTask();
marketDetail.ContentType = MarketplaceContentType.Applications;
marketDetail.ContentIdentifier = "{0a6b15e1-b155-e011-854c-00237de2db9e}";
marketDetail.Show();

 

However the ContentType is of type MarketPlaceContentType which has two options Applications and Music. By that definition you would expect the following to work:

MarketplaceDetailTask marketDetail = new MarketplaceDetailTask();
marketDetail.ContentType = MarketplaceContentType.Music;
marketDetail.ContentIdentifier = "{7dd0fb01-0100-11db-89ca-0019b92a3933}";
marketDetail.Show();

However the code above fails with a content argument exception which basically means you cannot pull up a specific album or song (you can get the GUID by searching on Zune.net). In order to get music from a launcher the following code will work, however, it depends on the accuracy of the description and may return multiple results.

MarketplaceSearchTask mst = new MarketplaceSearchTask();
mst.ContentType = MarketplaceContentType.Music;
mst.SearchTerms = "album name artist name";
mst.Show();


Comment Section

Comments are closed.