Windows phone 8 如何在WP8上的自定义存储上编辑联系人时收到通知

Windows phone 8 如何在WP8上的自定义存储上编辑联系人时收到通知,windows-phone-8,store,contact,Windows Phone 8,Store,Contact,我在这里面临一些严重的问题: 我正在创建一个处理联系人同步的Windows Phone 8应用程序,但我无法确定是否应该在服务器上更新本地联系人,因为我找不到任何东西来通知我的应用程序我的联系人存储中的联系人已被编辑(使用本机联系人应用程序) 我需要一个修订号之类的东西。 到目前为止,我发现的是ContactChangeRecord类,但它需要一个contact store修订,而我的类似乎总是相同的,即使在更改了联系人之后(1) 有人能帮我吗 修订号是contact store类的属性之一。还

我在这里面临一些严重的问题: 我正在创建一个处理联系人同步的Windows Phone 8应用程序,但我无法确定是否应该在服务器上更新本地联系人,因为我找不到任何东西来通知我的应用程序我的联系人存储中的联系人已被编辑(使用本机联系人应用程序)

我需要一个修订号之类的东西。 到目前为止,我发现的是ContactChangeRecord类,但它需要一个contact store修订,而我的类似乎总是相同的,即使在更改了联系人之后(1)


有人能帮我吗

修订号是contact store类的属性之一。还有一种“日志”,您可以在其中检查操作类型。

联系人存储的修订号应该更改。您可以检测联系人存储中的任何更改:

ContactStore cloudContactStore = await ContactStore.CreateOrOpenAsync(ContactStoreSystemAccessMode.ReadWrite, ContactStoreApplicationAccessMode.ReadOnly);

     // Assuming you already have created the contactStore and made some changes from the 
     // device like deleting, or renaming a contact
        var changeList = await cloudContactStore.GetChangesAsync(5);

        foreach (var change in changeList)
        {
            // Each change record returned contains the change type, remote and local ids, and revision number
            Debug.WriteLine(String.Format("Change Type: {0}\nLocal ID: {1}\nRemote ID: {2}\nRevision Number: {3}",
                change.ChangeType.ToString(),
                change.Id,
                await remoteIDHelper.GetUntaggedRemoteId(cloudContactStore, change.RemoteId),
                change.RevisionNumber));
            // Get the contact associated with the change record using the Id property.
            var contact = await cloudContactStore.FindContactByIdAsync(change.Id);
            if (contact != null)
            {
            }
        }
检查VisualStudio的调试输出。您应该看到联系人id以及所做更改的类型(创建、修改、删除)

查看此示例:了解更多详细信息