我的Windows 10 UWP应用程序有一个主“仪表板”,有几个listview项目。我想在Primary Tile中显示这些项目的内容。我所拥有的代码显示了磁贴中的内容,但是磁贴在几秒钟后停止翻转并且卡在其中一个listview项目中。我如何确保它不会停止在列表视图项目中循环,并且不会停止翻转。
以下是我的代码:
public MainPage()
{
TileUpdateManager.CreateTileUpdaterForApplication().EnableNotificationQueue(true);
}
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
UpdateMedium(new TileBindingContentAdaptive()
{
Children =
{
new TileText()
{
Text = "Some text from Listview item,
Style = TileTextStyle.Base,
Wrap = true
},
new TileText()
{
Text = "Some other text from the same listview item",
Style = TileTextStyle.CaptionSubtle,
Wrap = true
}
}
});
}
private void UpdateMedium(TileBindingContentAdaptive mediumContent)
{
TileContent content = new TileContent()
{
Visual = new TileVisual()
{
Branding = TileBranding.NameAndLogo,
TileMedium = new TileBinding()
{
Content = mediumContent
}
}
};
try
{
TileNotification tileNotification = new TileNotification(content.GetXml());
TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification);
}
catch
{
}
}
有人可以指出我的代码有什么问题吗?
感谢。