WP_3种磁贴效果设置

 

private void ApplicationBarIconButton_Click_1(object sender, EventArgs e)
        {
            var tileData = 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 = 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 = 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("已经将此页面固定到桌面!");
            }
        }
posted on 2014-07-17 23:45  v.e.n.u.s 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/jx270/p/3852440.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值