问题
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