我知道如何在 Windows 应用商店应用
中显示简单的动态磁贴
。我曾经对选择特定宽度的 XmlTemplate 字符串进行收费。
但是,我发现有些应用程序显示了 5 个不同的动态图 block 。例如,照片
应用循环显示 5 张图像,并且每 5 秒更改一次。
我如何在我的应用中执行此功能,或者如果您可以展示 Windows 8.1 示例中的应用演示,我将不胜感激。
最佳答案
这是一个msdn sample 。但对我来说这有点神秘。
通过简单的步骤,您应该创建 5 个图 block (或更少)并将它们放入通知队列中。启用队列并提供tileTagId。
这是我的代码:
AllTiles - 包含所有图 block 的数组。 AppTileId
- 次要图 block ID。您可以通过取消注释 CreateTileUpdaterForApplication
代码行,将其更改为主图 block 。
// Posting update
int tileTagId = 0;
foreach ( XmlDocument XmlTile in AllTiles )
{
TileNotification tileNotification = new TileNotification( XmlTile );
tileNotification.Tag = tileTagId.ToString();
TileUpdater secondaryTileUpdater = TileUpdateManager.CreateTileUpdaterForSecondaryTile( AppTileId );
//TileUpdater secondaryTileUpdater = TileUpdateManager.CreateTileUpdaterForApplication();
secondaryTileUpdater.EnableNotificationQueue( true );
secondaryTileUpdater.Update( tileNotification );
tileTagId++;
}
关于c# - 循环显示 5 个图像的动态图 block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21418788/