首页 > 代码库 > WP_3种磁贴效果设置
WP_3种磁贴效果设置
private void ApplicationBarIconButton_Click_1(object sender, EventArgs e)
{
var tileData = http://www.mamicode.com/new FlipTileData()
{
//前面数据
Title = item.Name,
BackgroundImage = new Uri(item.Images[0], UriKind.Relative),
//后面数据
BackTitle = item.Name,
BackContent = item.Desc.Substring(0, 30),
BackBackgroundImage = new Uri(item.Images[1], UriKind.Relative),
//宽屏数据
WideBackgroundImage = new Uri(item.Images[2], UriKind.Relative),
WideBackBackgroundImage = new Uri(item.Images[3], UriKind.Relative),
WideBackContent = item.Desc.Substring(0, 50)
};
var iconData = http://www.mamicode.com/new IconicTileData
{
BackgroundColor = System.Windows.Media.Color.FromArgb(255, 195, 61, 39),
Count = 3,
IconImage = new Uri("Assets/Logo.png", UriKind.RelativeOrAbsolute),
Title = item.Name,
WideContent1 = item.Desc.Substring(0, 10),
WideContent2 = item.Desc.Substring(10, 15),
WideContent3 = item.Desc.Substring(15, 30)
};
var cycleData = http://www.mamicode.com/new CycleTileData
{
Count = 9,
CycleImages = new List<Uri> {
new Uri(item.Images[0],UriKind.RelativeOrAbsolute),
new Uri(item.Images[1],UriKind.RelativeOrAbsolute),
new Uri(item.Images[2],UriKind.RelativeOrAbsolute),
new Uri(item.Images[3],UriKind.RelativeOrAbsolute)
},
SmallBackgroundImage = new Uri("Assets/Logo.png", UriKind.RelativeOrAbsolute),
Title = item.Name
};
try
{
ShellTile.Create(new Uri("/ItemDetail.xaml?name=" + item.Name, UriKind.Relative), cycleData, true);
}
catch (Exception)
{
MessageBox.Show("已经将此页面固定到桌面!");
}
}
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。