Over a million developers have joined DZone.

MarketplaceReviewTask and MarketplaceSearchTask

DZone's Guide to

MarketplaceReviewTask and MarketplaceSearchTask

· Mobile Zone ·
Free Resource

In Windows Phone applications you can not directly access other applications like phone calls or messaging. Also Windows Phone applications can’t directly access information stores like contacts or photos. To access those you need to make use of Launchers and Choosers that allow you to have indirect access to some phone features.

The isolated and sandboxed model of Windows Phone protects the user because the developer can’t access personal information or send text messages without the users permission. When you use Launchers or Choosers you invoke a built-in application that will perform the task and replace the currently running application.

Here you can find more information about Launchers and Choosers.

In my applications I wanted the user to be able to rate and/or review it from within the application, and also to check out more of my apps on Marketplace.

So in my application I created two buttons:

<Button Name="BtnReview"
        Content="Review this application"
        Click="BtnReview_Click" />
<Button Name="BtnMore"
        Content="More from DotNETForDevices"
        Click="BtnMore_Click" />

Now I have to navigate to my event handlers and add the following code:

private void BtnReview_Click(object sender, RoutedEventArgs e)
    MarketplaceReviewTask mrt = new MarketplaceReviewTask();
private void BtnMore_Click(object sender, RoutedEventArgs e)
    MarketplaceSearchTask mst = new MarketplaceSearchTask();
    mst.SearchTerms = "DotNETForDevices";
    mst.ContentType = MarketplaceContentType.Applications;

Clicking on those buttons will navigate me to Marketplace. At the same time my own application will move to the background where it is not active anymore. Using the Back Key     I can come back to my application at a later time.

To be continued…

Source: http://andreahaubner.blog.com/2011/11/03/marketplacereviewtask-marketplacesearchtask/


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}