C# UWP Toast可以工作,但图像(AdaptiveImage、ToastGenericHeroImage、ToastGenericAppLogo)不显示

C# UWP Toast可以工作,但图像(AdaptiveImage、ToastGenericHeroImage、ToastGenericAppLogo)不显示,c#,xml,uwp,windows-10,visual-studio-2017,C#,Xml,Uwp,Windows 10,Visual Studio 2017,我的目标是Windows10,最新的操作系统版本。我复制/粘贴了Microsoft adaptive toast示例中的一些内容,包括路径。这是我的密码: public void CreateToast(ToastViewModel model) { ToastContent content = new ToastContent() { Launch = "app-defined-string", Visual = new ToastVisual

我的目标是Windows10,最新的操作系统版本。我复制/粘贴了Microsoft adaptive toast示例中的一些内容,包括路径。这是我的密码:

public void CreateToast(ToastViewModel model)
{
    ToastContent content = new ToastContent()
    {
        Launch = "app-defined-string",

        Visual = new ToastVisual()
        {
            BindingGeneric = new ToastBindingGeneric()
            {
                Children =
                {
                    new AdaptiveText()
                    {
                        Text = "Photo Share"
                    },

                    new AdaptiveText()
                    {
                        Text = "Andrew sent you a picture"
                    },

                    new AdaptiveText()
                    {
                        Text = "See it in full size!"
                    },

                    new AdaptiveImage()
                    {
                        Source = "https://unsplash.it/360/180?image=1043"
                    }
                },
                HeroImage = new ToastGenericHeroImage()
                {
                    Source = "https://unsplash.it/360/180?image=1043"
                },
                AppLogoOverride = new ToastGenericAppLogo()
                {
                    Source = "https://unsplash.it/64?image=883",
                    HintCrop = ToastGenericAppLogoCrop.Circle
                }
            }
        }
    };

    var toast = new ToastNotification(content.GetXml());
    toast.Failed += (o, args) =>
    {
        var message = args.ErrorCode;
    };

    ToastNotificationManager.CreateToastNotifier().Show(toast);
}
土司会显示,但图像不会显示。有人有主意吗


编辑:根据@AVK的建议,我决定改用XML试一试;不幸的是,我也有同样的行为——敬酒会,但没有图片。下面是我的代码(尽管我承认我对XML知之甚少,所以这段代码可能是错误的):


这是一个Windows 10错误,导致应用程序的Toast通知不显示图像


无法修复此问题。

只有在清单中具有internet功能的桌面网桥应用程序才支持Http图像。经典Win32应用程序不支持http映像;您必须将图像下载到本地应用程序数据中,并在本地引用它。

当您创建实际的xml时,这是否有效?@AVK good question;我查一下out@AVK使用XML示例更新您是否在appx清单中声明了“internetClient”功能?@StefanWickMSFT我有Internet(客户端和服务器)、Internet(客户端)和专用网络(客户端和服务器)。我需要另一个吗?谢谢!你有关于这个bug的链接吗?@codeMonkey很遗憾,我没有找到关于这个bug的任何有用的细节,这就是为什么我会找到这个StackOverflow页面。
var template = ToastTemplateType.ToastImageAndText02;
var xml = ToastNotificationManager.GetTemplateContent(template);
var elements = xml.GetElementsByTagName("text");
var text = xml.CreateTextNode(model.Title);
elements[0].AppendChild(text);
var images = xml.GetElementsByTagName("image");
var srcAttribute = xml.CreateAttribute("src");
srcAttribute.Value = "https://unsplash.it/64?image=883";
images[0].Attributes.SetNamedItem(srcAttribute);
var toast = new ToastNotification(xml);
ToastNotificationManager.CreateToastNotifier().Show(toast);