Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/338.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在Windows Phone 8.1中更新Live互动程序_C#_Windows Phone 8.1_Live Tile - Fatal编程技术网

C# 在Windows Phone 8.1中更新Live互动程序

C# 在Windows Phone 8.1中更新Live互动程序,c#,windows-phone-8.1,live-tile,C#,Windows Phone 8.1,Live Tile,我正在尝试为windows phone 8.1构建自定义日历应用程序,并希望在应用程序磁贴上显示当前日期和日期。我正在尝试使用以下代码在开始屏幕中更新我的windows phone 8.1应用程序的磁贴 XmlDocument tileXml2 = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWide310x150PeekImageAndText01); var textElement2 = tileXml

我正在尝试为windows phone 8.1构建自定义日历应用程序,并希望在应用程序磁贴上显示当前日期和日期。我正在尝试使用以下代码在开始屏幕中更新我的windows phone 8.1应用程序的磁贴

 XmlDocument tileXml2 = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWide310x150PeekImageAndText01);
        var textElement2 = tileXml2.GetElementsByTagName("text")[0].AppendChild(tileXml2.CreateTextNode("some text"));

        var tileImage = tileXml2.GetElementsByTagName("image")[0] as XmlElement;
        tileImage.SetAttribute("src", "ms-appx:///Assets/WideLogo.png");


        var tn2 = new TileNotification(tileXml2);
        TileUpdateManager.CreateTileUpdaterForApplication().Update(tn2);


        XmlDocument tileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare150x150Block);
        var textElement = tileXml.GetElementsByTagName("text")[0].AppendChild(tileXml.CreateTextNode("01"));
        textElement = tileXml.GetElementsByTagName("text")[1].AppendChild(tileXml.CreateTextNode("Tue"));
        var tn = new TileNotification(tileXml);
        //.CreateTileUpdaterForApplication().
        //TileUpdateManager.CreateTileUpdaterForApplication().StartPeriodicUpdate()
        TileUpdateManager.CreateTileUpdaterForApplication("App").Clear();
        TileUpdateManager.CreateTileUpdaterForApplication("App").Update(tn);
但是当我运行代码时,tilesquare150x150块只会更新,而在更改tile大小时,tilewide310x150peek图像和text01不会更新


你能帮我更新多个瓷砖吗?另外,如何在应用程序互动程序上获取当前日期?谢谢

因为您在注册TileWide310x150PeeImageandText01后调用TileUpdateManager.CreateTileUpdateForApplication(“App”).Clear()。因此,所有更新都将被删除