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: Play with MarketPlace Detail Task in Windows Phone

How-to: Play with MarketPlace Detail Task in Windows Phone

Karthikeyan Anbarasan user avatar by
Karthikeyan Anbarasan
·
May. 06, 12 · Mobile Zone · Interview
Like (0)
Save
Tweet
4.11K Views

Join the DZone community and get the full member experience.

Join For Free

In this short tutorial we are going to see how to use the Market place detail task, with this task we can get the complete detail of a specified application. Market Place Detail task opens the Market Place Client application and searched for the application to show the detail information on the application. If the application name is not specified it takes the application from which the task is called so that it pulls the calling applications detail. Let us see the steps on how to achieve this task in real time for a Windows phone application.

Open Visual Studio 2010 IDE and create a new Silverlight for Windows Phone project with a valid project name as shown in the screen below. Once the project is created add some controls which are used to trigger the MarketPlace Detail Task as shown in the screen below.

image

Now drag and drop few controls to the screen which is used to trigger event that launches the Market Place Detail Task with the required Content type and Content Identifier specified by the end user. Once we designed the screen with the controls we can see the screen looks like below.

image

Now we need to write our code in the button click event to trigger the Market Place Detail task on the user click. To do that just go to the code behind and first add the USING handler code on top with the existing using statements as shown in the code below.

using Microsoft.Phone.Tasks;

Next is to add the below code to the button click event which basically creates an instance of the Market place Detail task and provide a content type (basically as Application or Music) and a search filter (the Contentidentifier which is the application unique id – you can find the application content identifier id from the application URL) which categorizes and pulls the data (complete details) from the market place as shown in the code below.

Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Tasks;

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

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            MarketplaceDetailTask mpdetail = new MarketplaceDetailTask();
            mpdetail.ContentIdentifier = "7c61caea-943d-4716-a436-29ba6f35a7bb";
            mpdetail.ContentType = MarketplaceContentType.Applications;
            mpdetail.Show();
        }
    }
}

 

image

Content Identifier – 7c61caea-943d-4716-a436-29ba6f35a7bb ( We have got this from the deep link url of the Windows Phone application which we uploaded and certified in the market place) we have temporarily hardcoded in the code behind.

Now we are done with our code, just run the application by pressing F5 directly from the keyboard or we can use the Build and execute the project option from the tool bar to run the application. Once the Build is successful we can see the Windows Phone emulator with the application and the expected outputs as shown in the screens below.

Output Screens:

image

So in this article we have seen how to use the Market Place Detail task, with which we can query the details of an application like the application description, name, screenshots etc. That’s it from this short tutorial on Windows Phone see you all in the next tutorial soon. Mean while Happy Programming!!!

Windows Phone Task (computing) application

Published at DZone with permission of Karthikeyan Anbarasan, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Why Is Software Integration Important for Business?
  • After COVID, Developers Really Are the New Kingmakers
  • Synchronization Methods for Many-To-Many Associations
  • Use Lambda Function URL To Write a Serverless App Backed by DynamoDB

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