In the namespace Microsoft.Phone.Task there are a number of external tasks that your Win7 Mobile application can launch, perform an action, and take the results back to your application.
These tasks include:
- PhoneCallTask- Making phone calls
- PhoneNumberChooserTask – Used to obtain a phone number from a contact.
- CameraCaptureTask– Used to allow users to take and return a new photo to their app.
- PhotoChooserTask– Used to allow users to select and return a photo to the application.
- EmailAddressChooserTask – Used to obtain the email address of a contact selected.
- EmailComposeTask– Used to send an email to a specified recipient.
- MarketplaceDetailTask – Launches the marketplace showing the details of the application.
- MarketplaceHubTask – Launches the windows phone marketplace client.
- MarketplaceReviewTask– Displays the review page on the marketplace for the application
- MarketplaceSearchTask– Shows the search results on the marketplace from given terms.
- SaveEmailAddressTask– Save an email address to a new or existing contact.
- SavePhoneNumberTask– Save a phone number to a new or existing contact.
- SearchTask– Launch a web search from given terms.
- SmsComposeTask– Launches the messaging application with a new SMS message displayed.
- WebBrowserTask– Launches the web site with a given URL.
- MediaPlayerLauncher – Launches the media player
For example, to have your Win7 Mobile application make a phone call you can do this by simply creating what is called the PhoneCallTask. The following example demonstrates how easy this is to do from a button click event:
private void PhoneBtn_Click(object sender, RoutedEventArgs e)
{
try
{
PhoneCallTask task = new PhoneCallTask();
task.PhoneNumber = “555-1212”;
task.Show();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Sending email is done in a similar way through the object called EmailComposeTask.
private void EmailBtn_Click(object sender, RoutedEventArgs e)
{
EmailComposeTask ect = new EmailComposeTask();
ect.To = "youremail@hotmail.com";
ect.Subject = "Hello world";
ect.Show();
}
Thanks,
–Mike








