First, let's introduce the number of selectors.
1. cameracapturetask-open the camera application and take a photo. The returned type is photoresult.
2. photochoosertask-select an image from picture gallery and set the return type to photoresult.
3. emailaddresschoosetask-select an email address from the contacts list
4. photnenumberchoosertask-select a phone number from the contacts list
5. saveemailaddresstask-save an email address for the contact
6. savephonenumbertask-save a phone number for the contact
Then we will introduce several starters in WP8.
1. emailcomposetask-write a new email
2. phonecalltask-call a specified phone number
3. smscomposetask-write new information
4. searchtask-specify keywords for Bing search
5. webbrowsertask-start IE browser to open the specified URL
6. marketplacedetaitask-start marketplace and specify the detailed information of the application
7. marketplacehubtask-start marketplace and display the applications or music of one of the two hubs
8. marketplacereviewtask-start marketplace and provide comments for the Application
9. marketplacesearchtask-start marketplace and execute related searches
10. mediaplayerlauncher-start mediaplayer
The above are all the starters and selectors in Windows Phone.
Easy to use
Example:
Starter
Code instance
First, write the following code in a button event:
Phonecalltask calltask = new phonecalltask ();
Calltask. displayname = "文"; // The username text displayed.
Calltask. phonenumber = http://www.ruanman.net; // phone number, for your reference here
Calltask. Show (); // remember to show ();
Selector
Instance code
First, define a global selector object (the following uses the phone number as an example)
Savephonenumbertask savenumber = new savephonenumbertask ();
Then, register the completed event of the object in the mainpage () method.
Savenumber. Completed + = savenumber_completed;
Write Data to the savenumber_completed event. perform operations when you click OK or cancel.
If (E. taskresult = taskresult. OK)
{
MessageBox. Show ("saved successfully ");
}
The last step is to process button events on the page.
Mainly Save the number and other operations are written in the button event
The Code is as follows:
Savenumber. phonenumber = "123456 ";
Savenumber. Show ();
Now the selector code is OK.
The implementation of all starters and selectors is like this.
Summary:
All tasks are shown () at the end.
The initiator only needs to call methods for the image.
The selector needs to register the completed event, perform the response operation in the event, and then process the event in the return to the button event. The completed event is also not available to the initiator.
So far, the starter and Selector are OK. This article is only suitable for beginners.
Text/WP8