【发布时间】:2011-11-06 20:46:34
【问题描述】:
我在使用各种选择器时遇到问题。 当我现在启动其中一个时,它应该返回到我的应用程序,我得到的只是一个“恢复”屏幕,其中的进度条动画不定。按返回或开始按钮什么也不做,过了一会儿它会进入主屏幕。并且该应用再次启动缓慢。
这发生在模拟器以及移动设备本身上。
我的班级使用无法返回的选择器的示例是:
public partial class Add : PhoneApplicationPage
{
GameInviteTask gameInviteTask;
public Add()
{
InitializeComponent();
gameInviteTask = new GameInviteTask();
gameInviteTask.Completed += new EventHandler<TaskEventArgs>(gameInviteTask_Completed);
}
private void TextBox_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
try
{
gameInviteTask.SessionId = "<my session id>";
gameInviteTask.Show();
}
catch (System.InvalidOperationException ex)
{
MessageBox.Show("An error occurred when choosing an email contact.");
}
}
void gameInviteTask_Completed(object sender, TaskEventArgs e)
{
switch (e.TaskResult)
{
//Game logic for when the invite was sent successfully
case TaskResult.OK:
MessageBox.Show("Game invitation sent.");
break;
//Game logic for when the invite is cancelled by the user
case TaskResult.Cancel:
MessageBox.Show("Game invitation cancelled.");
break;
// Game logic for when the invite could not be sent
case TaskResult.None:
MessageBox.Show("Game invitation could not be sent.");
break;
}
}
}
所有选择器都会发生这种情况。 我使用导航服务使用主页导航到此页面。
可能是什么问题?!
【问题讨论】:
标签: c# windows-phone-7