忽略 Windows 10 个应用程序中的大型磁贴更新

Ignoring large tile updates in Windows 10 App

我正在我的通用应用程序中实现中型、宽型和大型磁贴排队,以显示前 5 个新闻标题。在大图块中,我一次显示 2 个标题,所以如果有 5 个标题,则将有 5 个中宽图块,但 queue 中有 3 个大图块。由于在更新图块时,我们需要为所有图块大小提供有效载荷,因此我需要指定忽略来自第 4 次和第 5 次更新的大图块有效载荷。这与本机邮件应用程序的行为相同。

绑定元素中有一个 contentId 属性,我们可以(理论上)将其用于此目的 (msdn link)。但是,它在 Windows 10 中不起作用(我使用的是版本 1703 build 15063.296)。它曾经在 Windows 8.1 中工作。 Windows10这个机制有没有变化?

一年前,我曾使用 Windows 10 的旧版本问过这个问题 here,后来知道它已在内部版本中得到修复。但是,看起来它在最新的 GA 版本中仍未修复。所以我又来提问了。

Since while updating tiles, we need to provide payload for all tile sizes, I need to specify to ignore the large tile payload from the 4th and 5th update.

对于自适应图块,无需为所有图块大小提供有效负载。您可以根据您的要求提供有效载荷。因此,对于您的场景,您应该简单地省略其他两个 XML 有效负载的 TileLarge 绑定,如下所示:

  • Notification 1
    • TileMedium
    • TileWide
    • TileLarge
  • Notification 2
    • TileMedium
    • TileWide
    • TileLarge
  • Notification 3
    • TileMedium
    • TileWide
    • TileLarge
  • Notification 4
    • TileMedium
    • TileWide
  • Notification 5
    • TileMedium
    • TileWide

通过仅在三个有效负载中包含 TileLarge 绑定,平台将只能显示三个大型磁贴通知,因此用户将只能看到三个大型通知。这正是 MSN 新闻应用程序所做的。

我强烈建议使用这种方法而不是 contentId 属性,因为它会产生更小的 XML 有效载荷,从而更有效。 contentId 属性被认为已过时,不建议使用。如果您确实有效地使用了 contentId 而无法通过其他方式实现,请告诉我。