Jason94
Jason94

Reputation: 13610

Getting NotSupportedException when trying to set image from isolated storage

I'm trying to set image for my tile in the background agent for my application:

ShellTile t = ShellTile.ActiveTiles.First();

if (t != null)
{
    var filePath = Path.Combine("Tiles", "test1.jpg");

    StandardTileData tile = new StandardTileData();
    tile.Title = "Title text here";
    tile.BackgroundImage = new Uri(@"isostore:\" + filePath, UriKind.Absolute);
    t.Update(tile);
}

but then on t.Update(tile) it throws NotSupportedException :-( Isnt the path ("isostore:\") correct?

Upvotes: 1

Views: 145

Answers (1)

Pantelis
Pantelis

Reputation: 2060

new Uri(@"isostore:" + filePath, UriKind.Absolute);

Without the backslash.

Upvotes: 1

Related Questions