Common tasks in Windows Phone 7

Source: Internet
Author: User

1,//phonecalltask: Call

private void Btnphonecall_click (object sender, RoutedEventArgs e)
{
Phonecalltask task = new Phonecalltask ();
Task. PhoneNumber = "110";
Task. DisplayName = "Autumn Moonlight Xuan";
Task. Show ();
}

2.//smscomposetask: Send SMS

private void Btncomposesms_click (object sender, RoutedEventArgs e)

{
Smscomposetask task = new Smscomposetask ();
Task. to = "110";
Task. Body = "Hello!.";
Task. Show ();
}

3.//emailcomposetask: Send mail

Emailcomposetask task = new Emailcomposetask ();
Task. to = "[email protected]";
Task. Cc = "[email protected]";
Task. Subject = "Autumn Moonlight Xuan Test";
Task. Body = "Hello world! ";
Task. Show ();


4.//webbrowsertask: Open Web browser
private void Btnlaunchwebbrowser_click (object sender, RoutedEventArgs e)
{
Webbrowsertask task = new Webbrowsertask ();

Task. URL = "<a href=" http://http://www.cnblogs.com/qiuyueguangxuan/">http://www.cnblogs.com/qiuyueguangxuan</ A> ";
Task. Show ();
}

5.//searchtask: Search function
private void Btnlaunchsearch_click (object sender, RoutedEventArgs e)
{
Searchtask task = new Searchtask ();
Task. SearchQuery = "Autumn Moonlight Xuan";
Task. Show ();
}

6.//mediaplayerlauncher: Start Media Player
Mediaplayerlauncher task = new Mediaplayerlauncher ();
Task. Media = new Uri (@ "http://www.baidu.com/11.wmv");
Task. Show ();


7,//cameracapturetask: The task of taking pictures
private void Button1_Click (Object Sender,routedeventargs e)
{
Cameracapturetask camertask=new cameracapturetask ();
Camertask.completed+=new eventhandler<photoresult> (cameratask_completed);
Cameratask.show ();
}

void Cameratask_completed (object sender, Photoresult e)
{
Execute the code after the photo is completed
BitmapImage image=new BitmapImage ();
Image. SetSource (E.chosenphoto);
Image1. Source=image;
}


8,//photochoosertask call picture program, select Picture, and can be cut in meditation
Photochoosertask photo=new photochoosertask ();
Public Multiplemediatask ()//constructor
{
InitializeComponent ();
photocompleted + = new eventhandler<photoresult> (photo_completed);
}

void Photo_completed (object sender, Photoresult e)
{
BitmapImage image=new BitmapImage ();
Image. SetSource (E.chosenphoto);
Image1. Source=image;
}

9.//saveemailaddresstask Call the contact program and save the set email address to the selected contact or new contact.
private void Emailsavebtn_click (object sender, RoutedEventArgs e)
{
Saveemailaddresstask emailsave = new Saveemailaddresstask ();
Emailsave. email = "[email protected]"; emailsave.completed + = new eventhandler<taskeventargs> (emailsave_completed);
Emailsave. Show ();
}
void Emailsave_completed (object sender, Taskeventargs e)
{
Execute code after processing is saved
}

10,//emailaddresschoosertask Open the contact program, choose Contact email address</p>
private void Emailchooser_click (object sender, RoutedEventArgs e)
{
Emailaddresschoosertask emailchooser = new Emailaddresschoosertask ();
emailchooser.completed + = new eventhandler&lt; Emailresult&gt; (emailchooser_completed);
Emailchooser. Show ();
}

void Emailchooser_completed (object sender, Emailresult e)
{
This. Pagetitle.text = E.email;
}








Common tasks in Windows Phone 7

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.