gpt4 book ai didi

c# - WP7 芒果 : How do I delete a live tile?

转载 作者:太空狗 更新时间:2023-10-29 17:47:04 26 4
gpt4 key购买 nike

我正在使用以下代码在设备上创建动态磁贴:

ShellTile tile = ShellTile.ActiveTiles.FirstOrDefault();
StandardTileData newTileData = new StandardTileData
{
BackgroundImage = new Uri(string.Format("isostore:{0}", DefaultLiveTilePath), UriKind.Absolute),
Title = "Test"
};
tile.Update(newTileData);

稍后我想删除动态磁贴图像并在固定时将其恢复为应用程序图标。这可能吗?

最佳答案

根据这个blog你应该使用这段代码

public void DeleteExistingTile()  
{
var foundTile = ShellTile.ActiveTiles.FirstOrDefault(x => x.NavigationUri.ToString().Contains("DetailId=123"));

// If the Tile was found, then delete it.
if (foundTile != null)
{
foundTile.Delete();
}
}

关于c# - WP7 芒果 : How do I delete a live tile?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7367101/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com