如何在WindowsPhone8上使用c#添加CycleTile磁贴

本文关键字:添加 CycleTile 磁贴 WindowsPhone8 | 更新日期: 2023-09-27 17:58:23

我有以下代码用于在Windows Phone 8上添加磁贴,但我无法显示磁贴。

CycleTileData cycletile = new CycleTileData();
cycletile.Title = "Test";
cycletile.SmallBackgroundImage = new Uri(root.data[0].user.profile_picture,UriKind.RelativeOrAbsolute); 

如何在WindowsPhone8上使用c#添加CycleTile磁贴

您需要使用ShellTile.Create()将tile添加到开始屏幕。设置CycleImages属性也不会有任何影响。

List<Uri> list = [your image list];
Uri smallImage = [your image];
CycleTileData tileData = new CycleTileData() 
{ 
    Title = group.Title, 
    SmallBackgroundImage = smallImage
    CycleImages = list 
 }; 
 ShellTile.Create(new Uri(NavSource, UriKind.Relative), tileData, true); 

微软开发中心或Windows Phone Geek 上有很多示例