为什么我的Windows应用商店(Metro)应用程序没有出现在共享窗格中?

使用者服务

我已将我的应用程序设为共享目标(和源),并且可以与其他应用程序成功共享我的应用程序的内容,但是当我在另一个应用程序中(例如,邮件或IE)时,我无法与我的应用程序共享它们的内容不会作为可用的“共享目标”应用程序出现在“共享窗格”中。

我已经阅读并遵循了MSDN文档,签出了示例,并且还在Package.AppXManifest文件中设置了“共享目标声明”。

为什么,我该如何解决?


C#代码隐藏:

    ShareOperation shareOperation;
    private string sharedDataTitle;
    private string sharedDataDescription;
    private string shareQuickLinkId;
    private string sharedText;
    private Uri sharedUri;
    private IReadOnlyList<IStorageItem> sharedStorageItems;
    private string sharedCustomData;
    private string sharedHtmlFormat;
    private IReadOnlyDictionary<string, RandomAccessStreamReference> sharedResourceMap;
    private IRandomAccessStreamReference sharedBitmapStreamRef;
    private IRandomAccessStreamReference sharedThumbnailStreamRef;

    private void ReportStarted()
    {
        this.shareOperation.ReportStarted();
    }

    private void ReportCompleted()
    {
        this.shareOperation.ReportCompleted();
    }

    protected override async void OnNavigatedTo(NavigationEventArgs e)
    {
        RegisterForShare();

        try
        {
            this.shareOperation = (ShareOperation)e.Parameter;
            await Task.Factory.StartNew(async () =>
                {
                    ReportStarted();
                    // Retrieve data package properties.
                    this.sharedDataTitle = this.shareOperation.Data.Properties.Title;
                    this.sharedDataDescription = this.shareOperation.Data.Properties.Description;
                    this.shareQuickLinkId = this.shareOperation.QuickLinkId;

                    // Retrieve data package content.
                    if (this.shareOperation.Data.Contains(StandardDataFormats.Text))
                    {
                        try
                        {
                            this.sharedText = await this.shareOperation.Data.GetTextAsync();
                        }
                        catch (Exception exception)
                        {
                            // NotifyUser of error.
                        }
                    }
                    else if(this.shareOperation.Data.Contains(StandardDataFormats.Html))
                    {
                        try
                        {
                            this.sharedHtmlFormat = await this.shareOperation.Data.GetHtmlFormatAsync();
                        }
                        catch (Exception exception)
                        {

                        }
                    }
                    else if (this.shareOperation.Data.Contains(StandardDataFormats.Uri))
                    {
                        try
                        {
                            this.sharedUri = await this.shareOperation.Data.GetUriAsync();
                        }
                        catch (Exception exception)
                        {

                        }
                    }

                    // Get back to the UI thread.
                    await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
                        {
                            if (this.sharedText != null)
                            {
                                // Create a Note out of shared data.
                                CreateNote(this.sharedDataTitle, this.sharedText, null);
                                this.shareOperation.ReportDataRetrieved();
                            }

                            if (this.sharedUri != null)
                            {
                                CreateNote(this.sharedDataTitle, this.sharedUri.OriginalString, null);
                                this.shareOperation.ReportDataRetrieved();
                            }

                            if (this.sharedHtmlFormat != null)
                            {
                                CreateNote(this.sharedDataTitle, this.sharedHtmlFormat.ToString(), null);
                                this.shareOperation.ReportDataRetrieved();
                            }
                        });
                });
        }
        catch (Exception exception)
        {
            Debug.WriteLine(exception.Message);

        }

        if (e.NavigationMode == NavigationMode.Back)
        {
            navigatedBack = true;


        }

        base.OnNavigatedTo(e);
    }

App.xaml.cs:

    protected override void OnShareTargetActivated(ShareTargetActivatedEventArgs args)
    {
        var rootFrame = new Frame();
        rootFrame.Navigate(typeof(MainPage), args.ShareOperation);
        Window.Current.Content = rootFrame;
        Window.Current.Activate();
    }

任何帮助将不胜感激。

斯梅格斯

在包清单中,确保添加了“共享目标”的声明

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

为什么我的应用程序不会出现在应用程序商店或iTunes搜索中?

来自分类Dev

为什么我的图标和启动屏幕没有出现在Phonegap Android应用程序中?

来自分类Dev

为什么HTTP图像没有出现在HTTPS应用程序中?

来自分类Dev

为什么此Glass应用程序没有出现在Glass Launcher中?

来自分类Dev

谷歌页面没有出现在我的电子应用程序中

来自分类Dev

谷歌地图没有出现在我的KendoMobile应用程序中

来自分类Dev

UILabel没有出现在我的应用程序中

来自分类Dev

我的 firebase 聊天应用程序没有出现在要发送的消息应用程序列表中

来自分类Dev

应用程序没有出现在应用程序列表中?

来自分类Dev

应用程序出现在“共享”列表中

来自分类Dev

Xcode-在我的应用程序上启用iTunes文件共享,但是它没有出现在iTunes的列表中吗?

来自分类Dev

Xcode-在我的应用程序上启用iTunes文件共享,但是它没有出现在iTunes的列表中吗?

来自分类Dev

为什么我的伪元素出现在一个 HTML 演示中,而不出现在我的 angular 5 应用程序中?

来自分类Dev

如何使我的应用程序出现在vue native的共享列表中?

来自分类Dev

使用 html 标签和引导程序时,为什么文本出现在我闪亮的应用程序中

来自分类Dev

我如何找到崩溃的原因?我的应用程序没有出现在崩溃日志中

来自分类Dev

安装后,我的android应用程序没有出现在手机上

来自分类Dev

为什么以句点开头的对象没有出现在rstudio的全局环境窗格中?

来自分类Dev

为什么单击弹出菜单时导航栏出现在全屏应用程序中

来自分类Dev

为什么应用程序重复项出现在菜单中?

来自分类Dev

SplashScreenImage没有出现在Windows Phone应用中

来自分类Dev

如何使我的应用程序出现在应用程序选择器中?

来自分类Dev

如何使我的应用程序出现在“应用程序”列表中?

来自分类Dev

如果 NSExtensionActivationRule 仅设置为音频,则共享扩展不会出现在有能力的应用程序中

来自分类Dev

为什么应用程序强迫我按顺序使用按钮,因为它们出现在 MainActivity.java 上?

来自分类Dev

我的应用程序没有出现在模拟器中(在 stackoverflow 上尝试了所有解决方案)

来自分类Dev

如何注册我的应用程序,使其出现在Windows Phone 8.1运行时的phote编辑列表中

来自分类Dev

我希望我的轮播仅在Rails应用程序中出现在索引页面中

来自分类Dev

应用程序未出现在Dash中(14.04)

Related 相关文章

  1. 1

    为什么我的应用程序不会出现在应用程序商店或iTunes搜索中?

  2. 2

    为什么我的图标和启动屏幕没有出现在Phonegap Android应用程序中?

  3. 3

    为什么HTTP图像没有出现在HTTPS应用程序中?

  4. 4

    为什么此Glass应用程序没有出现在Glass Launcher中?

  5. 5

    谷歌页面没有出现在我的电子应用程序中

  6. 6

    谷歌地图没有出现在我的KendoMobile应用程序中

  7. 7

    UILabel没有出现在我的应用程序中

  8. 8

    我的 firebase 聊天应用程序没有出现在要发送的消息应用程序列表中

  9. 9

    应用程序没有出现在应用程序列表中?

  10. 10

    应用程序出现在“共享”列表中

  11. 11

    Xcode-在我的应用程序上启用iTunes文件共享,但是它没有出现在iTunes的列表中吗?

  12. 12

    Xcode-在我的应用程序上启用iTunes文件共享,但是它没有出现在iTunes的列表中吗?

  13. 13

    为什么我的伪元素出现在一个 HTML 演示中,而不出现在我的 angular 5 应用程序中?

  14. 14

    如何使我的应用程序出现在vue native的共享列表中?

  15. 15

    使用 html 标签和引导程序时,为什么文本出现在我闪亮的应用程序中

  16. 16

    我如何找到崩溃的原因?我的应用程序没有出现在崩溃日志中

  17. 17

    安装后,我的android应用程序没有出现在手机上

  18. 18

    为什么以句点开头的对象没有出现在rstudio的全局环境窗格中?

  19. 19

    为什么单击弹出菜单时导航栏出现在全屏应用程序中

  20. 20

    为什么应用程序重复项出现在菜单中?

  21. 21

    SplashScreenImage没有出现在Windows Phone应用中

  22. 22

    如何使我的应用程序出现在应用程序选择器中?

  23. 23

    如何使我的应用程序出现在“应用程序”列表中?

  24. 24

    如果 NSExtensionActivationRule 仅设置为音频,则共享扩展不会出现在有能力的应用程序中

  25. 25

    为什么应用程序强迫我按顺序使用按钮,因为它们出现在 MainActivity.java 上?

  26. 26

    我的应用程序没有出现在模拟器中(在 stackoverflow 上尝试了所有解决方案)

  27. 27

    如何注册我的应用程序,使其出现在Windows Phone 8.1运行时的phote编辑列表中

  28. 28

    我希望我的轮播仅在Rails应用程序中出现在索引页面中

  29. 29

    应用程序未出现在Dash中(14.04)

热门标签

归档