【问题标题】:Windows Phone Mango choosersWindows Phone 芒果选择器
【发布时间】:2011-11-06 20:46:34
【问题描述】:

我在使用各种选择器时遇到问题。 当我现在启动其中一个时,它应该返回到我的应用程序,我得到的只是一个“恢复”屏幕,其中的进度条动画不定。按返回或开始按钮什么也不做,过了一会儿它会进入主屏幕。并且该应用再次启动缓慢。

choosers problematic

这发生在模拟器以及移动设备本身上。

我的班级使用无法返回的选择器的示例是:

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


    【解决方案1】:

    我找到了问题...

    不幸的是,我在尝试一切时唯一没有尝试的是从运行 Tap 事件的文本框中删除 IsReadOnly。

    所以这是微软的错误:/

    Windows phone 7.1:当您从具有 IsReadOnly True 的文本框的 Tap 事件中运行选择器时,选择器不起作用。

    我会把它留在这里,以便它可以帮助其他人。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多