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

This blog post will guide you through several effective methods to troubleshoot and resolve the issue of Microsoft Edge not...
Windows 11 offers a range of audio enhancements that can enrich your listening experience. These enhancements include features like virtual...
Windows 11 brings a fresh and visually stunning design to your desktop, and one of the standout features is the...