gray laptop computer showing html codes in shallow focus photography

Searching Marketplace in Windows Phone with MarketplaceSearchTask using C#

The Windows Phone 7 SDK provides the MarketplaceSearchTask launcher that lets the developers to search Microsoft Marketplace for Windows Phone 7 in the App .

The MarketplaceSearchTask launches the Windows Phone Marketplace client application and then displays the search results .

You must also provide the keyword or search terms via the property SearchTerms .

Searching Marketplace in Windows Phone with MarketplaceSearchTask using C#

The MarketplaceSearchTask is defined in the namespace Microsoft.Phone.Tasks ,so you might need to include this namespace incase if it is not included in the c# code behind .

Just create an instance of MarketplaceSearchTask and set the SearchTerms and then Call the Show Method of the MarketplaceSearchTask .

public MainPage()
{
     InitializeComponent();
     MarketplaceSearchTask marketplaceSearchTask = new MarketplaceSearchTask();
     marketplaceSearchTask.SearchTerms = "Number Converter";
     marketplaceSearchTask.Show();

}

This will display the MarketPlace Search Screen  .

Searching Marketplace in Windows Phone with MarketplaceSearchTask using C#

You can also set the ApplicationType so that Search is done for Application or Music with the property ContentType of MarketplaceSearchTask like below .

public MainPage()
{
     InitializeComponent();
     MarketplaceSearchTask marketplaceSearchTask = new MarketplaceSearchTask();
     marketplaceSearchTask.SearchTerms = "Number Converter";
     marketplaceSearchTask.ContentType = MarketplaceContentType.Applications;
     marketplaceSearchTask.Show();

}

The ContentType here is the MarketplaceContentType enum that id again defined in the namespace Microsoft.Phone.Tasks

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn about the Win32 Error “0x000019E5 – ERROR_COULD_NOT_RESIZE_LOG” that you get when debugging system erors in...
In this post, you’ll learn about the error “CO_E_DBERROR 0x8004E02B” that is returned when working with COM based APIs or...
In this post, you’ll learn about the Win32 Error “0x000019D0 – ERROR_LOG_BLOCK_VERSION” that you get when debugging system erors in...