[英]How can I use SaveContactTask without exiting program in WP7?
当我使用此任务时,保存联系人后我无法在应用程序中做任何事情,除了显示带有消息的消息框外,当此任务完成后,如何再次返回我的应用程序!
This should work out the box. 这应该可以解决问题。 When task is finished your application takes control again.
任务完成后,您的应用程序将再次控制。 You can control task result using Completed event handler
您可以使用Completed事件处理程序控制任务结果
this.saveContactTask.Completed += new EventHandler<SaveContactResult>(saveContactTask_Completed);
private void saveContactTask_Completed(object sender, SaveContactResult e)
{
switch (e.TaskResult)
{
case TaskResult.OK:
MessageBox.Show("Contact is successfully saved.");
break;
case TaskResult.Cancel:
MessageBox.Show("The user canceled the task.");
break;
case TaskResult.None:
MessageBox.Show("NO information regarding the task result is available.");
break;
}
}
Here you can find fully functional example which works exactly as you want. 在这里,您可以找到功能完全一样的示例,该示例完全可以根据需要工作。 You may take a look and compare with your implementation
您可以看一下并与您的实现进行比较
http://windowsphonegeek.com/tips/8-How-to-use-SaveContactTask-in-Windows-Phone-Mango http://windowsphonegeek.com/tips/8-How-to-use-SaveContactTask-in-Windows-Phone-Mango
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.