WP7 Mango:如何删除动态磁贴?
我使用以下代码在设备上创建一个动态磁贴:
ShellTile tile = ShellTile.ActiveTiles.FirstOrDefault();
StandardTileData newTileData = new StandardTileData
{
BackgroundImage = new Uri(string.Format("isostore:{0}", DefaultLiveTilePath), UriKind.Absolute),
Title = "Test"
};
tile.Update(newTileData);
稍后我想删除动态磁贴图像并在固定时将其恢复为应用程序图标。这可能吗?
I'm creating a live tile on the device with the following code:
ShellTile tile = ShellTile.ActiveTiles.FirstOrDefault();
StandardTileData newTileData = new StandardTileData
{
BackgroundImage = new Uri(string.Format("isostore:{0}", DefaultLiveTilePath), UriKind.Absolute),
Title = "Test"
};
tile.Update(newTileData);
At a later point I would like to delete the live tile image and have it revert to the app icon when pinned. Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
评论(3)
月野兔2024-12-11 00:29:17
每次应用程序启动时,我都会使用以下代码将磁贴重置为正常状态:
private void ResetLiveTileToNormal()
{
ShellTile TileToFind = ShellTile.ActiveTiles.FirstOrDefault();
ShellTileData shellData = new StandardTileData
{
Title = "XXXXXXXX",
Count = 0,
BackContent = "",
BackTitle = "",
BackBackgroundImage = new Uri("", UriKind.Relative),
BackgroundImage = new Uri(@"/Images/LiveTiles/XXXXXX.png", UriKind.Relative)
};
TileToFind.Update(shellData);
}
染火枫林2024-12-11 00:29:17
ShellTile.ActiveTiles.FirstOrDefault();
已过时。
void clearTile() {
ShellTileData tileData = new StandardTileData
{
Title = "",
Count = 0,
BackContent = "",
BackTitle = "",
BackBackgroundImage = new Uri("", UriKind.Relative),
BackgroundImage = new Uri(@"/ApplicationIcon.png", UriKind.Relative)
};
IEnumerator<ShellTile> it = ShellTile.ActiveTiles.GetEnumerator();
it.MoveNext();
ShellTile tile = it.Current;
tile.Update(tileData);
}
基于研究并感谢 robertftw
~没有更多了~
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
根据此博客 你应该使用此代码
According to this blog you shoudl use this code