共享目标和JumpListItemBackgroundConverter

时间:2014-06-15 21:32:05

标签: windows-phone-8.1

我已将Share Target声明添加到我的应用程序中以获取数据格式WebLink,一切都按预期工作。但是,当我在应用程序的任何位置添加JumpListItemBackgroundConverter或JumpListItemForegroundConverter时,当您使用IE从“共享”进入应用程序时,应用程序将挂起在启动屏幕上。没有异常,没有崩溃,调试器甚至没有停止。我得到的只是输出窗口中的一个神秘错误,“程序'......'已退出代码-1073741819(0xc0000005)'访问冲突'。”这些转换器的文档说它们适用于通用应用程序,只是它们已被移动到不同的命名空间。有没有人能够在同一个应用程序中使用这两个东西?如果是的话,我哪里出错了?或者是否有比这两个转换器更好的东西来获得LongListSelector的外观和感觉?

重现的步骤:

  1. 创建一个新的通用应用。我选择了中心。
  2. 将格式WebLink的共享目标添加到appxmanifest声明。
  3. 添加新页面以将共享合同指向。
  4. 将OnShareTargetActivated代码添加到app.xaml.cs以打开新页面。见下面的代码
  5. 将JumpListItemBackgroundConverter添加到应用主页面的资源中。您不需要将其应用于任何事情,只需声明它足以打破共享。
  6. 转到IE并分享链接。它应该挂在闪屏上。
  7. app.xaml.cs的代码:

        protected override async void OnShareTargetActivated(ShareTargetActivatedEventArgs args)
        {    
             // Replace SharePage with the name of the share target page
             var rootFrame = new Frame();
             rootFrame.Navigate(typeof(SharePage), args.ShareOperation);
             Window.Current.Content = rootFrame;
             Window.Current.Activate();
        }
    

1 个答案:

答案 0 :(得分:0)

事实证明这是模拟器中的一个错误。如果您在物理设备上进行测试,它就可以工作。

MSDN Forum - JumpListItemBackgroundConverter and Share Target in Windows Phone 8.1