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
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
11 Monitoring and Observability Tools for 2023
Learn more

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
Share
9.90K 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

  • Spring Cloud
  • Building a RESTful API With AWS Lambda and Express
  • An End-to-End Guide to Vue.js Testing
  • DevSecOps: The Future of Secure Software Development

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • 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: