在Windows Phone 8.1中打开添加新联系人窗口

时间:2015-10-11 09:54:25

标签: c# windows-phone-8.1 winjs

我有一个添加联系人按钮,我希望它打开添加Windows手机的新联系人任务并返回添加的联系人

windows phone add new contact

就像android我已经知道我可以添加联系人从问题Adding contacts to People on Windows Phone 8.1 in C#

中抛出以下代码
using Windows.Phone.PersonalInformation;

public async void addPerson() {
    var store = await ContactStore.CreateOrOpenAsync();

    var contact = new StoredContact(store) {
        DisplayName = "Mike Peterson"
    };

    var props = await contact.GetPropertiesAsync();
    props.add(KnownContactProperties.Email, "mike@peterson.com");
    props.add(KnownContactProperties.MobileTelephone, "+1 212 555 1234");

    await contact.SaveAsync();
}

0 个答案:

没有答案