Simple code for calling from Windows Phone 7 using C# code

Hello friends,

Today I will explain how to make call using your C# code in Windows Phone.

It is very easy code you just need to write few lines and you are good to go. I will explain the concept of chooser and launchers later on please don’t worry about that right now.

So we start with a new project in which we add reference of Microsoft.Phone.Tasks.

On the screen we have added few names & there phone numbers textboxes.

We have added a call button for each name. Please see the below snap for design. Now in button click event you need to do following

  PhoneCallTask callTask = new PhoneCallTask();

callTask.DisplayName = this.txtName1.Text;

callTask.PhoneNumber = this.txtPhone1.Text;

callTask.Show();

Now when you click the call button you will find now you will get following screen which is a confirmation screen. In confirmation screen you will find the Display Name “Rajat Jaiswal” and phone number is there.

Now you can press call button and you will find you are calling Rajat Jaiswal at given number .

You can download the code at https://skydrive.live.com/?cid=1eda2012469ff8ad&id=1EDA2012469FF8AD!243

Enjoy calling

Rajat Jaiswal

Advertisements

One thought on “Simple code for calling from Windows Phone 7 using C# code

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