In this short tutorial we are going to see how to use a Share Link Task to share some links to the social networking. Most of the application developed are shared over the social network to reach the maximum audience, to share the application we provide the links to the most commonly used social networking sites like Facebook, Twitter, LinkedIn etc. In Windows Phone development we have been provided with a Launcher task to do this task of sharing a ling to the social networking of the user choice from the link. [more]
Let us see in detail on how to use this task and share a link to the social networking site.
Open Visual Studio 2010 IDE and create a new Silverlight for Windows Phone project with a valid project name as shown in the screen below. Once the project is created add some controls which are used to share the link to the social networking media.
Now we need to design our UI in such a way it gets input from the user (basically the link) and share it across to the selected Social Networking Media of our choice as shown in the screen below.
Now add the code below, which basically we added a namespace reference to
Microsoft.Phone.Tasks;
Now create an instance of ShareLinkTask where we need to set the properties of the link which we are going to share it across the Social Networking media as shown in the code below.
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Tasks;
namespace F5debugHowto8
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
ShareLinkTask shareLinkTask = new ShareLinkTask();
shareLinkTask.Title = "F5debug Share";
shareLinkTask.LinkUri = new Uri(textBox1.Text.ToString(), UriKind.Absolute);
shareLinkTask.Message = "F5debug – Building and Debugging the Technology!!!";
shareLinkTask.Show();
}
}
}
Now we are done with our code, just run the application by pressing F5 directly from the keyboard or we can use the Build and execute the project option from the tool bar to run the application. Once the Build is successful we can see the Windows Phone emulator with the application opened as shown in the screens below.
Output:
In real device we can see the option to share the link to the different social media over the fly like facebook, twitter, linkedin etc. So in this short tutorial we have seen how to use the share link task and the code which shares the link to the different social networking media. I am waiting to test over the applications on to the real device, mostly probably will be doing that in a couple of weeks. We will see another short tutorial pretty soon meanwhile Happy Programming!!!
No Comments
Having low self-esteem can also result from other issues not<br />directly related to sexual performance. The Bluze Capsules<br />and Mast Mood Oil are commonly available in the internet and also in many of the pharmacies that are near your home.
Heya i'm for the first time here. I found this board and I find It really useful & it helped me out a lot. I hope to give something back and aid others like you helped me.|
Hi. Fabulous posting you have written above. For me personally, you have nailed all the critical pointers and I've even bookmarked this article for future reading. Keep writing and I appreciate you for posting the useful tips.