Windows Phone 8.1 contacts vs. calendars

Source: Internet
Author: User

(1) Contact person (Manifest get permission)

1) Get Contacts

There are two ways to get a contact

A. Contactpicker

Contactpicker is the direct opening of a system to select the contact interface, let the user choose, you can set a single or multiple selection:

varContactpicker =NewContactpicker (); ContactPicker.DesiredFieldsWithContactFieldType.Add (contactfieldtype.phonenumber);//Windows.ApplicationModel.Contacts.Contact contact = await contactpicker.pickcontactsasync ();Windows.ApplicationModel.Contacts.Contact contact =awaitContactpicker.pickcontactasync ();if(Contact! =NULL) {Messagedialog dialog=NewMessagedialog (string. Format ("Phone number: {0}", contact. Phones.first (). Number), contact.    DisplayName); awaitdialog. Showasync ();}

A unique contactfieldtype must be set.

B. Contactmanager

You can search for a contact directly via the Contactmanager API:

await Contactmanager.requeststoreasync (); var await Contactstore.findcontactsasync (SearchTextBox.Text.Trim ());

Gets the list of contacts as read-only.

2) Contact the contact person

You can make a call directly to a contact, send a text message, send an email:

Phonecallmanager.showphonecallui ("15911111111","Some"); Chatmessage message=Newchatmessage (); message. Recipients.add ("15911111111"); message. Body="Test.";awaitchatmessagemanager.showcomposesmsmessageasync (message); Emailmessage Email=Newemailmessage (); email. To.add (NewEmailrecipient ("[email protected]") ; email. Body="Test.";awaitEmailmanager.showcomposenewemailasync (email);

(2) Calendar

1) Open the system's calendar app directly

For example, open the Calendar main screen:

await Appointmentmanager.showtimeframeasync (Datetimeoffset.now, Timespan.fromhours (1));

2) API mode

For example, create a new calendar event:

New""= datetimeoffset.now; // ... await New Rect ());

More APIs: Links

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.