Windows 8 Live Tile Help Agent Using C #

I try to update live tile so often in Windows 8, and it needs to be done even if the application itself is not working. None of the notification options listed on this MSDN page are suitable, I want to poll system information, such as processor temperature, etc., which does not suit the styles listed notifications.

I looked elsewhere on StackOverflow and saw similar questions, but for Windows Phone 7 using background workers . Using a background worker seems like the right answer for me. However, textbooks like the previous ones focus on Windows Phone 7, where the situation is slightly different, the Windows Store templates in Visual Studio 2012 Ultimate do not have C # templates for scheduled task agents, for example.

So my question is, how can we set up background workers for Windows 8 applications to pre-update the live fragment when the application itself is down?

+3
source share
2 answers

U can read about background tasks here ; read about TimeTrigger here , and in the OnCompleted method when working with a background job we can set LiveTile

void OnCompleted(BackgroundTaskRegistration sender, BackgroundTaskCompletedEventArgs args) { var tile = CreateNotification(String.Format(@"<tile> <visual> <binding template=""TileSquareText04""> <text id=""1"">{0}</text> <text id=""2""></text> </binding> <binding template=""TileSquareText02""> <text id=""1"">{0}</text> <text id=""2""></text> </binding> </visual> </tile>", DateTime.Now.ToString("hh:mm:ss"))); TileUpdateManager.CreateTileUpdaterForApplication().Update(tile); } private TileNotification CreateNotification(string xml) { var xmlDocument = new XmlDocument(); xmlDocument.LoadXml(xml); return new TileNotification(xmlDocument); } 
+3
source

Check out the white paper: Introduction to Background Tasks ; Meanwhile, and what you have already learned and learned about tiles, you should be able to collect something.

+1
source

All Articles