比如说,我想定期更新 Windows 8 动态磁贴,比如 10 秒后。有没有办法做到这一点?我在 Windows 8 中使用 Metro xaml c#。
这是我在 Dispatcher Timer 的 Tick 事件上编写的代码:
switch(imageIndex)
{
case 0:
imageUrl = "Assets/Image1.png";
break;
case 1:
imageUrl = "Assets/Image1.png";
break;
case 2:
imageUrl = "Assets/Image1.png";
break;
}
ITileWIdeImageAndText01 tileContent = TileContentFactory.CreateTileWideImageAndText01();
tileContent.TextCaptionWrap.Text = "Hello";
tileContent.Image.Src = imageUrl;
tileContent.Image.Alt = "";
ITileSquareImage squareContent = TileContentFactory.CreateTileSquareImage();
squareContent.Image.Src = imageUrl;
squareContent.Image.Alt = "";
tileContent.SquareContent = squareContent;
TileUpdateManager.CreateTileUpdaterForApplication().Update(tileContent.CreateNotification());
提前致谢。