我在使用各种选择器时遇到问题。 当我现在启动其中一个时,它应该返回到我的应用程序,我得到的只是一个“恢复”屏幕,其中的进度条动画不确定。按下后退或开始按钮什么都不做,过了一会儿它会回到主屏幕。应用程序再次启动缓慢。
这发生在模拟器和手机本身上。
我的类(class)使用无法返回的选择器的示例是:
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;
}
}
}
所有选择器都会发生这种情况。 我使用导航服务使用主页导航到这个页面。
可能是什么问题?!
最佳答案
我找到问题了...
不幸的是,我在尝试一切时唯一没有尝试的是从运行 Tap 事件的文本框中删除 IsReadOnly。
所以这是一个 Microsoft 错误 :/
Windows phone 7.1:当您从具有 IsReadOnly True 的文本框的 Tap 事件运行选择器时,它们不起作用。
我会把它留在这里,以便它可以帮助其他人。
关于c# - Windows Phone 芒果选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8030263/