How to Search for Music in the Windows Phone Marketplace using MarketplaceSearchTask?

The developers can make use of the MarketplaceSearchTask to search the Windows Phone Marketplace for a specific search keywords. Not just the apps, the MarketplaceSearchTask also lets the users to search music in the Windows Phone store.

How to Search for Music in the Windows Phone Marketplace using MarketplaceSearchTask?

To search for Music in the Windows Phone Marketplace, create an instance of the MarketplaceSearchTask and set the Content Type to Music and call the show method of the instance as shown below.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using PhoneApp3.Resources;
using Microsoft.Phone.Tasks;

namespace PhoneApp3
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            SearchSong();
        }

        private void SearchSong()
        {
            MarketplaceSearchTask searchTask = new MarketplaceSearchTask();
            searchTask.ContentType = MarketplaceContentType.Music;
            searchTask.SearchTerms = "Nee Entha ooru";
            searchTask.Show();

        }
    }
}

Once the show method of the MarketplaceSearchTask instance is called, the Windows Phone Marketplace App is launched with the search results as per the keywords provided.

In the above example, I searched for the keyword / song “Nee Entha Ooru” , one of the popular song from the Movie “Thirupaachi” featuring Ilayathalapathy Vijay.

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...