Windows Phone 7 devices obtain applications through the Windows Marketplace hub. This is available from the Start screen, but you can
invoke the hub in your code in a variety of ways. You can open the hub to show specific types of content such as applications, music, or podcasts. You can also open the hub showing a filtered list of items from one of these categories using a search string, or you can just show a specific item by specifying its GUID content identifier. Finally, you can open the Reviews screen.
The following code examples show how you can use the Windows Marketplace task launchers in your application code.
C#
// Open the Windows Marketplace hub to show all applications.
MarketplaceHubTask marketPlace = new MarketplaceHubTask();
marketPlace.ContentType = MarketplaceContentType.Applications;
// Other options are MarketplaceContentType.Music
// and MarketplaceContentType.Podcasts.
marketPlace.Show();
// —————————————————–
// Open the Windows Marketplace hub to search for
// applications using a specified search string.
MarketplaceSearchTask marketSearch = new MarketplaceSearchTask();
marketSearch.ContentType = MarketplaceContentType.Applications;
marketSearch.SearchTerms = “Tailspin Surveys”;
marketSearch.Show();
// —————————————————–
// Open the Windows Marketplace hub with a specific
// application selected for download and installation.
MarketplaceDetailTask marketDetail = new MarketplaceDetailTask();
marketDetail.ContentType = MarketplaceContentType.Applications;
marketDetail.ContentIdentifier
= “{12345678-1234-1234-1234-123456789abc}”;
marketDetail.Show();
// —————————————————–
// Open the Windows Marketplace hub Review page.
MarketplaceReviewTask marketReview = new MarketplaceReviewTask();
marketReview.Show();
If you call the Show method of the MarketplaceDetailTask class without specifying a value for the ContentIdentifier property, the
task will show the Windows Marketplace page for the current application.
For more information about the tasks described in this section, and the other types of tasks available on Windows Phone 7 devices, see “Microsoft.Phone.Tasks Namespace” on MSDN (http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks(VS.92).aspx).
If you want to provide a link to a specific product on Windows Marketplace within a Web page or another application, you can do so
by specifying the appropriate product ID in the link. The following shows the format of a link to an application on Windows Marketplace.
http://social.zune.net/redirect?type=phoneApp&id=12345678-1234-1234-1234-123456789abc&source=MSDN