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 will learn about sync provider notifications in Windows 11 and how to disable or enable it...
In this tutorial, let’s learn how to enable or disable the startup sound in Windows 11. By default, when Windows...
The CameraCaptureTask allows the Windows Phone 7 App to launch the Camera Application . This will be useful when the...