none
Win8.1 发送磁贴更新,磁贴没有反应。 RRS feed

  • 问题

  • XmlDocument tileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWide310x150ImageAndText01);

                XmlNodeList tileTextAttributes = tileXml.GetElementsByTagName("text");
                tileTextAttributes[0].InnerText = "你好世界!我自己的瓷砖通知";

                XmlNodeList tileImageAttributes = tileXml.GetElementsByTagName("image");
                ((XmlElement)tileImageAttributes[0]).SetAttribute("src", "ms-appx:///Assets/redWide.jpg");
                ((XmlElement)tileImageAttributes[0]).SetAttribute("alt", "red graphic");

                XmlDocument squareTileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare150x150Text04);
                XmlNodeList squareTileTextAttributes = squareTileXml.GetElementsByTagName("text");
                squareTileTextAttributes[0].AppendChild(squareTileXml.CreateTextNode("你好世界!我自己的瓷砖通知"));
                IXmlNode node = tileXml.ImportNode(squareTileXml.GetElementsByTagName("binding").Item(0), true);
                tileXml.GetElementsByTagName("visual").Item(0).AppendChild(node);

                TileNotification tileNotification = new TileNotification(tileXml);
                tileNotification.ExpirationTime = DateTimeOffset.UtcNow.AddSeconds(30);
                TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification);

    此为更新磁贴的代码,在WP8.1 上磁贴是可以更新的。但是在win8.1上磁贴没有反应。

    求解!

    2015年1月5日 3:19

答案

  • 你好 十八子,

    代码看起来好像没问题,你如果试一下sample,看看能否正确更新磁贴?App tiles and badges sample

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2015年1月6日 5:59
    版主