updating tiles in Win 8 Metro app

爱⌒轻易说出口 提交于 2019-12-11 23:29:40

问题


Hi in my metro app i have set the wide logo in appxmainfest file and then in page on button click i have written this code

XmlDocument tileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWideText03);
var textElement = tileXml.GetElementsByTagName("text")[0].AppendChild(tileXml.CreateTextNode("Hey This my Text Updated on Tile"));
var tn = new TileNotification(tileXml);
TileUpdateManager.CreateTileUpdaterForApplication().Update(tn);

but at the last line it give me error.

The application identifier provided is invalid. at Windows.UI.Notifications.TileUpdateManager.CreateTileUpdaterForApplication() at TilesCS.ScenarioInput1.UpdateTileWithText_Click(Object sender, RoutedEventArgs e) in c:\Users\nitin\Downloads\App tiles and badges sample\C#\ScenarioInput1.xaml.cs:line 68

I tried the sample app by Microsoft but it also has the same issue. I searched other sample app and code but what ever I tried they all gives error.

In one article I read that I need to set some attribute of tile to dynamic but I cant fine it anywhere. Does any one know where I am wrong.


回答1:


Just solved it. I was running it in simulator where it will give error. But if we run the app in localmachine then it wors fine. So run the app on local machine and not on simulator when working on updating tiles



来源:https://stackoverflow.com/questions/10311832/updating-tiles-in-win-8-metro-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!