While creating application for Windows Phone you may come across requirement to share certain message from your application on social media sites configured on user device. You can do it using ShareStaus Task. ShareStausTask class is defined as below. It is inherited from ShareTaskBase class.

image

 

ShareStatus Task Launcher allows an application to launch a dialog that allows user to share status message on social network site.

A status message can be shared as below,


ShareStatusTask shareStatusTask = new ShareStatusTask();
shareStatusTask.Status = "Hey I am Shared By DebugMode";
shareStatusTask.Show();


You may come across other scenario where you may need to share HyperLink across Social Media sites from your application. You can do that using launcher ShareLinkTask.

ShareLinkTask class is defined as below,

image

ShareLink Task Launcher allows an application to launch a dialog that allows user to share links on social network site.

A link can be shared as below,



ShareLinkTask shareLinkTask = new ShareLinkTask();
shareLinkTask.Title = "DebugMode";
shareLinkTask.LinkUri = new Uri("http://debugmode.net", UriKind.Absolute);
shareLinkTask.Message = "Post of DebugMode.";
shareLinkTask.Show();

These launchers will be launched only if user has configured social media sites on their device. I hope this post is useful. Thanks for reading.

Advertisements

2 thoughts on “Code to Share Status or Links on Social Media sites in Windows Phone

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s