将项目从WP7升级到WP8后,动态磁贴无效。有谁知道原因? 我已经完成了自定义磁贴,我将其保存为IsolatedStorage中的图片。 计划代理中的Tile代码:
.
.
.
ShellTile tile = ShellTile.ActiveTiles.FirstOrDefault();
if (tile != null)
{
FlipTileData data = new FlipTileData()
{
SmallBackgroundImage = new Uri("isostore:" + mediumTile, UriKind.RelativeOrAbsolute),
BackgroundImage = new Uri("isostore:" + mediumTile, UriKind.RelativeOrAbsolute),
WideBackgroundImage = new Uri("isostore:" + wideTile, UriKind.RelativeOrAbsolute)
};
tile.Update(data);
}
NotifyComplete();
答案 0 :(得分:0)
要在IsolatedStorage中使用图像,您需要使用/ Shared / ShellContent路径。以下是修复代码:
ShellTile tile = ShellTile.ActiveTiles.FirstOrDefault();
if (tile != null)
{
FlipTileData data = new FlipTileData()
{
SmallBackgroundImage = new Uri("isostore:/Shared/ShellContent/" + mediumTile, UriKind.RelativeOrAbsolute),
BackgroundImage = new Uri("isostore:/Shared/ShellContent/" + mediumTile, UriKind.RelativeOrAbsolute),
WideBackgroundImage = new Uri("isostore:/Shared/ShellContent/" + wideTile, UriKind.RelativeOrAbsolute)
};
tile.Update(data);
}
NotifyComplete();