我有这个代码:
private async void ButtonSelectContact_OnTapped(object sender, TappedRoutedEventArgs e)
{
var contactPicker = new Windows.ApplicationModel.Contacts.ContactPicker
{
CommitButtonText = "Invite"
};
var contact = await contactPicker.PickSingleContactAsync();
if (contact != null)
{
textBoxPerson.Text = contact.Name;
textBoxEmail.Text = contact.Emails[0].ToString();
}
}
..效果很好,除了选择联系人后,textBoxEmail.Text 包含“Windows.ApplicationModel.Contacts.ContactField”(应该类似于“rupertTpupkin@kingOfComedy.com”)。