The previous development experience on SMS, Phone, Email, and Camera on Windows mobile is no longer valid because WP7 does not provide APIs for direct operation. However, this does not mean that it cannot be done, because in WP7, system tasks can be called through tasks, that is to say, you need to open the system-related applications to make calls, send text messages, save contacts, and take photos.
In addition, because the system application is called, that is, to open another program in your own program, because the WP7 system is a single Task system, after the Task is started, your application will be terminated.
If it is in debug, you can continue debugging by pressing F5. In the application, because the program already has Tombstone, you do not need to invoke the program to call the Task, however, the related status must be maintained by yourself.
1. Phone Task: a Task used to open the dialing interface in the application. You can call the Task directly and set the contact name and the called Phone number.
PhoneCallTask phonecall = new PhoneCallTask ();
Phonecall. DisplayName = "Town ";
Phonecall. PhoneNumber = "13567890000 ";
Phonecall. Show ();
II. SMS Task: You can open the system SMS program, set the content and sender of the SMS to be sent, or send MMS, but it seems that you can only send images, I wonder if sound files and other files can be sent to the real machine.
SmsComposeTask sms = new SmsComposeTask ();
Sms. Body = "Test sms ";
Sms. To = "13567890000 ";
Sms. Show ();
3. Save Phone Number Task: You can call the contact program to Save the set Phone Number to the selected contact or create a new contact.
SavePhoneNumberTask SavePhoneNumber = new SavePhoneNumberTask ();
SavePhoneNumber. PhoneNumber = "15888812345 ";
SavePhoneNumber. Completed + = new EventHandler <TaskEventArgs> (SavePhoneNumber_Completed );
SavePhoneNumber. Show ();