DZone
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 >

ShareStatusTask and ShareLinkTask - new ways of sharing content through Windows Phone OS (Mango)

Denzel D. user avatar by
Denzel D.
·
Jul. 02, 11 · · Interview
Like (0)
Save
Tweet
9.70K Views

Join the DZone community and get the full member experience.

Join For Free

With the new release of the developer tools being available, the guys from the Windows Phone team introduced two interesting classes that allow content sharing directly from a third-party application. These classes are:

  • ShareStatusTask
  • ShareLinkTask

ShareStatusTask allows the user (or developer, since he actually is able to invoke the task) to post a status to one of the services linked with the user account on the physical device. For example, this includes Facebook, Windows Live and later on possibly Twitter and LinkedIn.

Both ShareStatusTask and ShareLinkTask classes are processing the request for the same application:

app://5B04B775-356B-4AA0-AAF8-6491FFEA5615/MePublish

As with the Marketplace and internal applications, the app URI scheme is not available externally (through WebBrowserTask or by typing the address in Internet Explorer). The URL above is called when the Show method is called for the task, and not surprisingly - the tasks are invoked the same way as any other standard task in NoDo:

ShareStatusTask task = new ShareStatusTask();
task.Status = "User Status";
task.Show();

Status is the only available property, so there is nothing overly complicated about using this class. One thing to remember, however, is the fact that whenever the Show method is called, the status won't be automatically set - to avoid misguided usage, the user will have to confirm the status provider and the status itself.

Both ShareStatusTask and ShareLinkTask inherit from ShareTaskBase, that is the link to the sharing application. What's even more interesting - it appears that at a later time developers will be able to do much more than simply share things but also perform check-ins (Facebook Places and/or Foursquare integration?):

ShareLinkTask is a bit different - it allows sharing web content to the same services that are registered on the device and that are compatible with the content being shared. Take a look at this snippet:

ShareLinkTask task = new ShareLinkTask();
task.LinkUri = new Uri("http://dennisdel.com");
task.Message = "Check out my blog";
task.Title = "Den by default";
task.Show();

For now there is no way to define the sharing provider through the class (although I just filled a Microsoft Connect ticket). Also, the sharing mechanism will not work in the emulator - you will need a physical device updated to the dev release of Mango to see the results.

Windows Phone Mango (software)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How to Build Microservices With Node.js
  • Creating an Event-Driven Architecture in a Microservices Setting
  • What's the Difference Between Static Class vs. Singleton Patterns in C#?
  • SSH Tutorial: Nice and Easy [Video]

Comments

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