post icon

Silverlight: Tasks on the Win7 Mobile Phone

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:

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

2 Comments

Leave a comment
  1. Alex
    25. Feb, 2011 at 10:19 am #

    You have some mistypes in marketplace related tasks

Trackbacks/Pingbacks

  1. Silverlight: Tasks on the Win7 Mobile Phone | www.nalli.net - 26. Feb, 2011

    [...] Everything Silverlight In the namespace Microsoft.Phone.Task there are a number of external tasks that your Win7 Mobile [...]