How to get first name and last name from ContactInformation?

匿名 (未验证) 提交于 2019-12-03 10:10:24

问题:

I'm using the ContactPicker in a Windows Store application, and I need to retrieve the first name and last name separately for the selected contact. Unfortunately, the ContactInformation class only has a Name property, where both parts of the name are concatenated. The CustomFields property is empty.

I find it hard to believe that there is no way to access the first name and last name, since they are stored separately in the Contacts application...

Any idea?

回答1:

The ContactInformation class has been deprecated in Windows 8.1, and replaced by the Contact class, which provides more detailed information, including first and last name.

EDIT: actually, this doesn't work; the FirstName property contains the concatenated first and last name, and the LastName property is empty... Not sure if this is a bug in the ContactPicker API or in the Contacts app.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!