在我的应用程序中,我 AddressChooserTask
用来获取联系方式
AddressChooserTask m_AddressChooserTask = new AddressChooserTask();
m_AddressChooserTask.Completed += new EventHandler<AddressResult>(OnAddressChooserTaskCampleted);
m_AddressChooserTask.Show();
但每次我的事件处理程序出错时
void OnAddressChooserTaskCampleted(object sender, AddressResult e)
{
if (e.TaskResult == TaskResult.OK)
{
m_ContactRec.m_Name = e.DisplayName.ToString();
}
if (m_ContactRec.m_Name != null)
{
Contacts m_contacts = new Contacts();
m_contacts.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(OnContactsSearchCompleted);
m_contacts.SearchAsync(m_ContactRec.m_Name, FilterKind.DisplayName, null);
}
}
调试器停在这里m_contacts.SearchAsync
。我有点困惑,这个事件 cleary 在 UI 线程中,你能告诉我我在做什么错吗?