我正在向我的应用用户发送磁贴更新。在更新磁贴后,我想在用户单击新磁贴后自动将用户定向到新的更新页面。有什么方法可以实现这个目标吗?
我不能再拉服务器了,因为它是 fire& amp;忘记机制。
使用Toast通知,我可以在通知中使用以下消息:
<wp:Param>/Views/MyPage.xaml</wp:Param>
但这似乎不适用于我的 FlipTile 更新。
答案 0 :(得分:0)
我不太确定这是否是您要找的,但是您可以在应用加载后更换Tile吗?有点像这样:
/// <summary>
/// Creates or replaces a tile with a Title and a parameter
/// </summary>
public void replaceTile()
{
//ShellTile TileToFind = ShellTile.ActiveTiles.First();
string tileTitle = "Title of the Tile";
//You might want to use your Parameter from the toast here as the PageName
ShellTile TileToFind = FindTile( "/PageName.xaml?parameter" );
StandardTileData NewTileData = new StandardTileData
{
Title = tileTitle,
BackgroundImage = new Uri( "/Resources/tile_icon.png", UriKind.Relative ),
Count = 0,
BackTitle = "",
//BackBackgroundImage = new Uri("/Resources/appicon_large.png", UriKind.Relative),
BackBackgroundImage = new Uri( "", UriKind.Relative ),
BackContent = ""
};
// Application should always be found, since it is always the first tile (even if not on homescreen)
if ( TileToFind == null )
{
// Update the Application Tile with the NewTileData
//TileToFind.Update( NewTileData );
//Or replace an existing (second) tile with the new, updated Tile
//ShellTile alreadyExistingTile = FindTile( "/PageName.xaml?parameter" );
//if ( alreadyExistingTile != null )
//{
// alreadyExistingTile.Delete();
//}
ShellTile.Create( new Uri( "/PageName.xaml?parameter=" + newParameter, UriKind.Relative ), NewTileData );
}
else
{
TileToFind.Update( NewTileData );
}}