Over a million developers have joined DZone.

MarketplaceReviewTask and MarketplaceSearchTask

· Mobile Zone

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"
        Grid.Row="6"
        Content="Review this application"
        Click="BtnReview_Click" />
<Button Name="BtnMore"
        Grid.Row="7"
        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();
    mrt.Show();
}
 
private void BtnMore_Click(object sender, RoutedEventArgs e)
{
    MarketplaceSearchTask mst = new MarketplaceSearchTask();
    mst.SearchTerms = "DotNETForDevices";
    mst.ContentType = MarketplaceContentType.Applications;
    mst.Show();
}


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/

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

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

{{ parent.tldr }}

{{ parent.urlSource.name }}