Windows phone 8 在移除活动磁贴的后台代理后,自动将其还原为静态磁贴
我的应用程序的主磁贴具有实时磁贴功能。但是,如果我关闭live tile功能,当我返回开始屏幕时,我的应用程序的主互动程序仍然显示live tile的最后状态 我想知道一旦关闭live tile功能,我需要做什么才能将我的应用程序的主互动程序恢复到静态?目前,我需要调整瓷砖的大小或删除/重新插入它以获得此效果 这是我关闭活动互动程序时运行的代码:Windows phone 8 在移除活动磁贴的后台代理后,自动将其还原为静态磁贴,windows-phone-8,telerik,windows-phone,live-tile,background-agents,Windows Phone 8,Telerik,Windows Phone,Live Tile,Background Agents,我的应用程序的主磁贴具有实时磁贴功能。但是,如果我关闭live tile功能,当我返回开始屏幕时,我的应用程序的主互动程序仍然显示live tile的最后状态 我想知道一旦关闭live tile功能,我需要做什么才能将我的应用程序的主互动程序恢复到静态?目前,我需要调整瓷砖的大小或删除/重新插入它以获得此效果 这是我关闭活动互动程序时运行的代码: // Remove the Background Agent for the live tile.
// Remove the Background Agent for the live tile.
ScheduledActionService.Remove("PeriodicTaskForLocation");
// Update tile.
RadFlipTileData extendedData = new RadFlipTileData()
{
WideVisualElement = null,
WideBackVisualElement = null,
IsTransparencySupported = true
};
ShellTile tile = ShellTile.ActiveTiles.First();
if (tile != null)
{
tile.Update(extendedData);
LiveTileHelper.UpdateTile(tile, extendedData);
}
这就成功了:
// Remove the Background Agent for the live tile.
RemoveAgent("PeriodicTaskForLocation");
// Delete tile.
ShellTile tile = ShellTile.ActiveTiles.First();
if (tile != null)
{
RadFlipTileData extendedData = new RadFlipTileData();
extendedData.IsTransparencySupported = true;
extendedData.WideBackgroundImage = new Uri("/Assets/Tiles/Icon.png", UriKind.Relative);
extendedData.WideBackVisualElement = null;
LiveTileHelper.UpdateTile(tile, extendedData);
}