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