我做了款应用,主磁贴是会翻转的,但我在设置中加了个“是否翻转磁贴”的设置,可以取消磁贴的翻转,
翻转的磁贴前后都是图片:
var tile = Microsoft.Phone.Shell.ShellTile.ActiveTiles.First(); if (tile != null) { var tileData = new Microsoft.Phone.Shell.FlipTileData() { Title = "标题", SmallBackgroundImage = new Uri("isostore:/Shared/ShellContent/FlipCycleTileSmall.jpg"), BackgroundImage = new Uri("isostore:/Shared/ShellContent/FlipCycleTileMedium.jpg"), BackBackgroundImage = new Uri("isostore:/Shared/ShellContent/FlipCycleTileMediumBack.jpg"), WideBackgroundImage = new Uri("isostore:/Shared/ShellContent/FlipCycleTileLarge.jpg"), }; tile.Update(tileData); }
但是取消翻转如何设置BackBackgroundImage 属性??
var tile = Microsoft.Phone.Shell.ShellTile.ActiveTiles.First(); if (tile != null) { var tileData = new Microsoft.Phone.Shell.FlipTileData() { Title = "标题", SmallBackgroundImage = new Uri("Assets/Tiles/FlipCycleTileSmall.png", UriKind.Relative), BackgroundImage = new Uri("Assets/Tiles/FlipCycleTileMedium.png", UriKind.Relative), BackBackgroundImage = ?// 如何设置这个属性,使其不再翻转,设置为null,还会翻转, WideBackgroundImage = new Uri("Assets/Tiles/FlipCycleTileLarge.png", UriKind.Relative), }; tile.Update(tileData); }
设置BackBackgroundImage为一个不存在的地址:
BackBackgroundImage=new Uri("aaaa.png", UriKind.Relative),
其中aaaa.png不存在,且必须是UriKind.Relative,否则会报错,