Friday, November 16, 2012

How to use the Marketplace tasks in Windows Phone 8

published on: 11/15/2012 | Views: N/A | Tags: wp8dev Tasks

Not yet rated. Be the first to rate this tip!

by WindowsPhoneGeek

In this post I am going to talk about how to use the different Marketplace associated tasks in a Windows Phone 8 application: MarketplaceDetailTask , MarketplaceHubTask, MarketplaceReviewTask , MarketplaceSearchTask. This article is part of the series of 21 quick posts focused on working with the Windows Phone 8 Tasks.? Here is the what is included in this series:

NOTE: All tasks in Windows Phone 8 are located in the following namespace:? Microsoft.Phone.Tasks, so whenever you use any of the tasks in code behind you will have to include the following using directive:

using Microsoft.Phone.Tasks;

MarketplaceHubTask

MarketplaceHubTask launches the Windows Phone Marketplace client application. Set the ContentType property to a value from the MarketplaceContentType enumeration in order to launch the hub to a particular type of content:

  • MarketplaceContentType.Music - music content
  • MarketplaceContentType.Applications - application content

Example:

MarketplaceHubTask marketplaceHubTask = new MarketplaceHubTask();
 marketplaceHubTask.ContentType = MarketplaceContentType.Applications;
 marketplaceHubTask.Show();

marketplace2_thumb1

MarketplaceSearchTask

MarketplaceSearchTask launches the Windows Phone Marketplace client application which then shows the search results based on search terms you provide. Note that you can search by SearchTerms(keyword) and ContentType.

Example:

MarketplaceSearchTask marketplaceSearchTask = new MarketplaceSearchTask();
 marketplaceSearchTask.SearchTerms = "games";
 marketplaceSearchTask.Show();

marketplace4_thumb1

MarketplaceDetailTask

MarketplaceDetailTask launches the Windows Phone Marketplace client application and shows the details page for a product specified by the unique identifier you provide. Content identifier is the product ID from the manifest. You can set another external ID or if left empty, then it should use the current app product ID.
The default ContentType is ContentType.Applications so there is no need to change it if you're bringing up your Application details page.

Example:

MarketplaceDetailTask marketplaceDetailTask = new MarketplaceDetailTask();
 marketplaceDetailTask.ContentIdentifier = "34a64bd8-3bc5-4438-91c4-1f0c072e8524";
 marketplaceDetailTask.Show();

marketplace1_thumb1

MarketplaceReviewTask

MarketplaceReviewTask launches the Windows Phone Marketplace client application which then displays the review page for your application.

Example:

MarketplaceReviewTask marketplaceReviewTask = new MarketplaceReviewTask();
 marketplaceReviewTask.Show();

That was all about using different Marketplace tasks in a Windows Phone 8 app. Here is the full source code:

State tuned for the rest of the posts in this series.

You can also follow us on Twitter @winphonegeek

Comments

Source: http://feedproxy.google.com/~r/Windowsphonegeek/~3/IWDC3PZZZeQ/how-to-use-the-marketplace-tasks-in-windows-phone-8

spice mike starr ufc 141 fight card gli joseph gordon levitt katy perry russell brand mark hurd

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.