C# Windows Phone 8.1中的Microsoft.Phone.UserData在哪里?

C# Windows Phone 8.1中的Microsoft.Phone.UserData在哪里?,c#,windows-phone-8,C#,Windows Phone 8,我正在使用Windows 8.1和Visual Studio 2013。据我所知,一切都是最新的。所以我想要的是获取联系人列表,但即使在谷歌搜索之后,我也无法找到 据我所知,我所要做的就是使用Microsoft.Phone.UserData,然后我就可以愉快地获得联系人了。问题是,我不能,因为有一个错误表明Microsoft.Phone.*不存在 我是不是错过了什么。根据上面的网站,它适用于Windows Phone 8和Windows Phone Silverlight 8.1 | Windo

我正在使用Windows 8.1和Visual Studio 2013。据我所知,一切都是最新的。所以我想要的是获取联系人列表,但即使在谷歌搜索之后,我也无法找到

据我所知,我所要做的就是使用Microsoft.Phone.UserData
,然后我就可以愉快地获得联系人了。问题是,我不能,因为有一个错误表明
Microsoft.Phone.*
不存在

我是不是错过了什么。根据上面的网站,它适用于Windows Phone 8和Windows Phone Silverlight 8.1 | Windows Phone OS 7.1


另外,这是关于blank app(Windows Phone)项目的问题,我也遇到过同样的问题,我想这可能是因为如果我查找Microsoft.Phone类,我会在8.0目录中找到它。就我而言

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\WindowsPhone\v8.0\

然后我只是通过浏览文件来引用它。我不确定您打算使用它做什么,以及这些类是否与8.1兼容。但我希望这会有所帮助。

您正在阅读针对Windows Phone 8的教程,而事实上您很可能正在使用WinRT for Windows Phone 8.1

您需要使用
ContactManager
类来使用该类。 下面是来自

公共异步void FindContacts(字符串搜索文本)
{
ContactStore ContactStore=等待ContactManager.RequestStoreAsync();
IReadOnlyList contacts=null;
if(String.IsNullOrEmpty(searchText))
{ 
//查找所有联系人
contacts=等待contactStore.FindContactsAsync();
}
其他的
{
//根据搜索字符串查找联系人
contacts=等待contactStore.FindContactsAsync(searchText);
}
MyContactListBox.ItemsSource=联系人;
}
如果您想以旧版本的windows phone为目标,您可能需要阅读


如果我在针对特定版本的windows phone时使用了什么版本的SDK存在疑问,请提供帮助。

您创建了哪种类型的项目?也许你的目标是Windows Phone 8.1?正如文章提到的,这在Windows Phone 8.1上不受支持(Windows Phone Silverlight 8.1不相同)是的,它是Windows Phone 8.1应用程序。在Windows phone中,silverlight 8.1现在可以正常工作。windows phone 8.1中无法使用(不再使用)有什么特殊原因吗?windows phone 8.1在很大程度上与windows 8/8.1共享相同的WinRT API。因此,必须以与Windows应用商店应用程序相同的方式进行操作。当你想了解如何为Windows Phone 8.1实现某些功能时,最好的方法是查看Windows 8文档,看看它是否也适用于Windows Phone 8.1(通常是这样,但并不总是这样)@Thierry在阅读之后,我认为你是对的。你会考虑把你的评论作为答案吗?
public async void FindContacts(string searchText)
{
    ContactStore contactStore = await ContactManager.RequestStoreAsync();

    IReadOnlyList<Contact> contacts = null;

    if(String.IsNullOrEmpty(searchText))
    { 
        // Find all contacts
        contacts = await contactStore.FindContactsAsync();
    }
    else
    {
        // Find contacts based on a search string
        contacts = await contactStore.FindContactsAsync(searchText);
    }

    MyContactListBox.ItemsSource = contacts;
}