I have a windows 8 metro app that displays data on a live tile which is refreshed every minute.
When the metro app is started it creates a sequence to do the tile updates. This works perfectly.
The problem:
When I restart my computer the metro tile stops working. Instead it goes back to the default metro tile (app name bottom left image middle).
I can get it to work again by simply starting and stopping the metro app. But I do not wish to do this.
I implement a class that implements IBackgroundTask and implements the run method.
public void Run(IBackgroundTaskInstance taskInstance){
BackgroundTaskDeferral deferral = taskInstance.GetDeferral();
TileScheduler.CreateSchedule();
deferral.Complete();
}
In the metro app package manifest added declaration "Background Task" and under entry point pointed to this class. I also register timer and system event.
This class code basically calls the same code path the main app does when setting the tile sequence for the first time except that it is wrapped with a deferral.
The Question Is this the right path (as it doesn't seem to be working so I guess my implementation is wrong)? or is there a better way to do this?