0

将项目从 WP7 升级到 WP8 后,动态磁贴不起作用。有谁知道原因?我已经完成了一个自定义磁贴,并将其作为图片保存在 IsolatedStorage 中。Scheduled Agent 中的 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();
4

1 回答 1

0

为了在您的独立存储中使用图像,您需要使用 /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();
于 2014-01-27T16:58:05.737 回答