DZone
Mobile Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Mobile Zone > How to Launch the WP7 Marketplace Hub (using the MarketplaceHubTask)

How to Launch the WP7 Marketplace Hub (using the MarketplaceHubTask)

Kunal Chowdhury user avatar by
Kunal Chowdhury
·
Mar. 08, 12 · Mobile Zone · Interview
Like (1)
Save
Tweet
2.51K Views

Join the DZone community and get the full member experience.

Join For Free

In our previous Windows Phone 7 tips, we learnt how to search applications and/or music in the WP7 marketplace using the MarketplaceSearchTask API.

Today in this post, we will learn about the MarketplaceHubTask API to launch the Windows Phone 7 Hub client in your phone device. Using the code, you can also launch it in the phone emulator. Continue reading to learn more about it.

Know about the API

“MarketplaceHubTask” is a launchers task which allows user to launch the marketplace hub client and display the marketplace items in the screen. You can customize the API to search either Application or Music contents by providing the MarketplaceContentType property as shown below:

public enum MarketplaceContentType { Applications = 1, Music = 2 }


If you specify the ContentType of MarketplaceSearchTask as Application, it will show only applications and if you specify Music, it will show only music.

Code and Demo

Now it’s time for us to see the code and demo. Let us first demonstrate the use of the Application content type to launch the hub client with only applications. The following code implements the same:

var marketplaceHubTask = new MarketplaceHubTask
                                {
                                    ContentType = MarketplaceContentType.Applications,
                                };
 
marketplaceHubTask.Show();


Here is the screenshot of what you will see when you execute the above code:

 

If you want to launch the client for music, you need to change the ContentType as shown here:

var marketplaceHubTask = new MarketplaceHubTask
                                {
                                    ContentType = MarketplaceContentType.Music,
                                };
 
marketplaceHubTask.Show();


Calling the Show() method actually executes and launches the proper screen of the Hub client. Here is the screenshot of the Music screen:

 

Hope, this small post was helpful for you to understand the use of the API “MarketplaceHubTask”. Stay tuned to my blog, facebook and twitter for many more articles, news and tips on Silverlight and Windows Phone 7.




application Windows Phone

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Java’s Encapsulation - When the Getter and Setter Became Your Enemy
  • A Brief History of the DMCA
  • Refactor Switch to a One-Liner
  • Is Your Code DRY or WET?

Comments

Mobile Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo