How to get first name and last name from ContactInformation?

好久不见. 提交于 2019-12-08 05:35:55

问题


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.



来源:https://stackoverflow.com/questions/17110947/how-to-get-first-name-and-last-name-from-contactinformation

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