如何在Windows Phone应用程序8.0中访问联系人?
问题描述:
我有一个输入电话号码的表单。如何在Windows Phone应用程序8.0中访问联系人?
用户应该能够通过点击一个按钮从他的联系人列表中选择联系人。当用户选择一个联系人,数字应出现在表单中的文本框..
能有人好心帮我这个代码... 任何形式的帮助表示赞赏......
答
using Microsoft.Phone.UserData;
是你在找什么..
喜欢的东西:
private void ButtonContacts_Click(object sender, RoutedEventArgs e)
{
Contacts cons = new Contacts();
//Identify the method that runs after the asynchronous search completes.
cons.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(Contacts_SearchCompleted);
//Start the asynchronous search.
cons.SearchAsync(String.Empty, FilterKind.None, "Contacts Test #1");
}
void Contacts_SearchCompleted(object sender, ContactsSearchEventArgs e)
{
//Do something with the results.
MessageBox.Show(e.Results.Count().ToString());
}
在此我的文档s很详细:MSDN
你可以显示一些工作证明..你有什么尝试等? – Pogrindis
这是一个问题和答案网站。这意味着你提供了一段代码,这些代码不适用于显示你已经尝试过,然后我们可以帮助你解决代码的问题和失败。您应该阅读本文并提出更好的问题:http://stackoverflow.com/help/how-to-ask – Baklap4