zoukankan      html  css  js  c++  java
  • 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("已经将此页面固定到桌面!");
                }
            }
  • 相关阅读:
    如何替换文件中的部分内容?
    将文件中的行倒序输出,并写入文件
    如何统计文件中除去空行的数据的行数?
    统计文件行数,统计特殊行(例如,统计含有数字的行数)
    Array,String,Set,Map
    python 操作 word 图片 消失
    es6
    Promise
    英文
    前端框架vue.js系列(9):Vue.extend、Vue.component与new Vue
  • 原文地址:https://www.cnblogs.com/jx270/p/3852440.html
Copyright © 2011-2022 走看看