4

我正在向我的应用用户发送磁贴更新。磁贴更新后,我想在用户单击新磁贴后自动将用户引导到新的更新页面。有什么办法可以做到这一点?

我不能再拉服务器了,因为它是一种即发即忘的机制

通过 toast 通知,我可以在通知中使用以下消息:

<wp:Param>/Views/MyPage.xaml</wp:Param>

但这似乎不适用于我的FlipTile更新。

4

1 回答 1

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 );
}}
于 2013-05-29T16:28:22.283 回答