c# - Windows Phone 芒果选择器

标签 c# windows-phone-7

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

choosers problematic

这发生在模拟器和手机本身上。

我的类(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/

相关文章:

c# - Microsoft SQL Server 如何将数据从一个表复制到另一个表

c# - Entity Framework 6 : Creating database with multiple contexts

c# - 我需要帮助将 c# 匿名方法转换为 vb.net

c# - 查找二叉树中叶到根路径的最大总和

.net - 如何在 VB .Net 中为 Windows Phone 7 调用电话?

c# - 获取子元素的所有属性

android - 不同移动平台的文件格式是什么

windows-phone-7 - 为 Windows Phone 7 安装 Json.NET 时出现以下错误

windows-phone-7 - 在 MVVM 架构中调用 Windows Phone 7 中的 Web 服务

c# - WP7邮件客户端是否使用ActiveSync