In my WP7 application, I create an image for a live tile and save it in isolated storage. Then an updated live tile is available for my periodic task, and in this regard everything works fine for the periodic task.
I have a problem in my foreground WP7 application when I create a real-time image. I am also updating live tiles (since I know something has changed, so why wait for a periodic task). But when a real-time update occurs here, it seems that he cannot find the newly created file and therefore is a live tile without a bitmap.
In terms of the corresponding code
File creation
var source = new BitmapImage(new Uri("Images/Tiles/Class Timetable with T.png", UriKind.Relative)); source.CreateOptions = BitmapCreateOptions.None; source.ImageOpened += (sender, e) =>
and actual conservation
and code that actually extracts the image and updates the live fragment (and works in a periodic task, but not from the application itself
string imageString = "isostore:/Shared/ShellContent/" + nextEvent.UniqueId + ".jpg"; ShellTile defaultTile2 = ShellTile.ActiveTiles.First(); defaultTile2.Update(new StandardTileData { Title = nextTime, BackgroundImage = (new Uri(imageString, UriKind.Absolute)), });
Just unsure if I am doing something fundamentally wrong here? I am considering storing the generated image in a database with its object. And here I have a manageable number of files. I do not generate hundreds of things.
I have a workaround which is to update the livetile from a WP7 application without using an image file.
source share