public void Run(IBackgroundTaskInstance taskInstance) { using (device = new CanvasDevice()) { try { GenerateTileImage(TileTemplateType.TileSquare150x150Image, 150, 150); GenerateTileImage(TileTemplateType.TileWide310x150Image, 310, 150); } catch (Exception e) { if (device.IsDeviceLost(e.HResult)) { // When the device is lost we don't attempt to retry, and instead just wait for // the next time the task runs. return; } // Any other errors we bubble up throw; } } UpdateLiveTiles(); DeleteOldLiveTileImageFiles(); LiveTileUpdater.SetLatestTileImagesInSettings(tiles.Values); }
void liveTileUpdater_NewLiveTileGenerated(LiveTileUpdater sender, object args) { DispatchUpdateUI(); }