WindowsPhone 7.8 Tiles 3 : 7.8的Tiles利器mangopollo

利用mangopollo可以让我们在7.8方便的创建live tiles…

Mangopollo will allow you to easily take advantage of new windows phone tiles (cyclic, flip, iconic) if your application is run from a Windows Phone 7.8 or 8 as well as new launchers if your application is run from a Windows Phone 8 while remaining compatible with windows phone 7.

安装mangopollo可以通过nuget

PM> Install-Package Mangopollo

 

还是来看使用效果吧

首先是判断:

        //判断是否wp8
        private void TestIfWP8_Click(object sender, RoutedEventArgs e)
        {
            if (Utils.IsWP8)
            {
                MessageBox.Show("It's a Windows Phone 8 !");
            }
            else
            {
                MessageBox.Show("It's a Windows Phone 7 !");
            }
        }

 

        //判断是否支持新的Tiles
        private void TestIfWP78_Click(object sender, RoutedEventArgs e)
        {
            if (Utils.CanUseLiveTiles)
            {
                MessageBox.Show("It's a Windows Phone 7.8 or sup !");
            }
            else
            {
                MessageBox.Show("It's a Windows Phone 7 !");
            }
        }

 

创建CycleTile:

        private void CreateCycleTile_Click(object sender, RoutedEventArgs e)
        {
            if (!Utils.CanUseLiveTiles)
            {
                MessageBox.Show("This feature needs Windows Phone 8");
                return;
            }
            try
            {
                var mytile = new CycleTileData
                    {
                        Title = "cyclic tile",
                        Count = 42,
                        SmallBackgroundImage = new Uri("/Assets/logo159x159.png", UriKind.Relative),
                        CycleImages = new List<Uri> {new Uri("/Assets/Image1.png", UriKind.Relative), new Uri("/Assets/Image2.png", UriKind.Relative), new Uri("/Assets/Image3.png", UriKind.Relative)}
                    };


#if ALTERNATIVE_SOLUTION
                var mytile = Mangopollo.Tiles.TilesCreator.CreateCyclicTile("cyclic tile", 42, new Uri("/Assets/logo159x159.png", UriKind.Relative), new List<Uri>() { new Uri("/Assets/Image1.png", UriKind.Relative), new Uri("/Assets/Image2.png", UriKind.Relative), new Uri("/Assets/Image3.png", UriKind.Relative) });
#endif
                ShellTileExt.Create(new Uri("/MainPage.xaml?msg=from%20cycle%20tile", UriKind.Relative), mytile, false);
            }
            catch
            {
                MessageBox.Show("remove tile before create it again");
            }
        }

        private void CreateCycleTileWide_Click(object sender, RoutedEventArgs e)
        {
            if (!Utils.CanUseLiveTiles)
            {
                MessageBox.Show("This feature needs Windows Phone 8");
                return;
            }

            try
            {
                var mytile = new CycleTileData
                    {
                        Title = "cyclic wide tile",
                        Count = 42,
                        SmallBackgroundImage = new Uri("/Assets/logo159x159.png", UriKind.Relative),
                        CycleImages = new List<Uri> {new Uri("/Assets/Image1.png", UriKind.Relative), new Uri("/Assets/Image2.png", UriKind.Relative), new Uri("/Assets/Image3.png", UriKind.Relative)}
                    };

#if ALTERNATIVE_SOLUTION
                var mytile = Mangopollo.Tiles.TilesCreator.CreateCyclicTile("cyclic wide tile", 42, new Uri("/Assets/logo159x159.png", UriKind.Relative), new List<Uri>() { new Uri("/Assets/Image1.png", UriKind.Relative), new Uri("/Assets/Image2.png", UriKind.Relative), new Uri("/Assets/Image3.png", UriKind.Relative) });
#endif
                ShellTileExt.Create(new Uri("/MainPage.xaml?msg=from%20wide%20cycle%20tile", UriKind.Relative), mytile, true);
            }
            catch
            {
                MessageBox.Show("remove tile before create it again");
            }
        }
 
效果:

image

 

 

创建IconicTile:

        private void CreateIconicTile_Click(object sender, RoutedEventArgs e)
        {
            if (!Utils.CanUseLiveTiles)
            {
                MessageBox.Show("This feature needs Windows Phone 8");
                return;
            }
 
            try
            {
                var mytile = new IconicTileData
                    {
                        Title = "iconic tile",
                        Count = 8,
                        BackgroundColor = Colors.Purple,
                        IconImage = new Uri("/Assets/logo202x202.png", UriKind.Relative),
                        SmallIconImage = new Uri("/Assets/logo110x110.png", UriKind.Relative)
                    };
 
#if ALTERNATIVE_SOLUTION
                var mytile = Mangopollo.Tiles.TilesCreator.CreateIconicTile("iconic tile", 8, Colors.Purple, new Uri("/Assets/logo202x202.png", UriKind.Relative), new Uri("/Assets/logo110x110.png", UriKind.Relative));
#endif
 
                ShellTileExt.Create(new Uri("/MainPage.xaml?msg=from%20iconic%20tile", UriKind.Relative), mytile, false);
            }
            catch
            {
                MessageBox.Show("remove tile before create it again");
            }
        }
 
 
        private void CreateIconicTileWide_Click(object sender, RoutedEventArgs e)
        {
            if (!Utils.CanUseLiveTiles)
            {
                MessageBox.Show("This feature needs Windows Phone 8");
                return;
            }
 
            try
            {
                var mytile = new IconicTileData
                    {
                        Title = "iconic tile",
                        Count = 8,
                        BackgroundColor = Color.FromArgb(255, 200, 10, 30),
                        IconImage = new Uri("/Assets/logo202x202.png", UriKind.Relative),
                        SmallIconImage = new Uri("/Assets/logo110x110.png", UriKind.Relative),
                        WideContent1 = "Mangopollo Library",
                        WideContent2 = "use Windows Phone 8 features",
                        WideContent3 = "on Windows Phone 7 apps"
                    };
 
#if ALTERNATIVE_SOLUTION
                var mytile = Mangopollo.Tiles.TilesCreator.CreateIconicTile("iconic wide tile", 8, Colors.Gray, new Uri("/Assets/logo202x202.png", UriKind.Relative), new Uri("/Assets/logo110x110.png", UriKind.Relative), "Mangopollo Library", "created by", "Rudy Huyn");
#endif
                ShellTileExt.Create(new Uri("/MainPage.xaml?msg=from%20wide%20iconic%20tile", UriKind.Relative), mytile, true);
            }
            catch
            {
                MessageBox.Show("remove tile before create it again");
            }
        }

效果:

image

 

创建FlipTile:

        private void CreateFlipTile_Click(object sender, RoutedEventArgs e)
        {
            if (!Utils.CanUseLiveTiles)
            {
                MessageBox.Show("This feature needs Windows Phone 8");
                return;
            }
 
            try
            {
                var mytile = new FlipTileData
                    {
                        Title = "wide flip tile",
                        BackTitle = "created by",
                        BackContent = "Rudy Huyn",
                        Count = 9,
                        SmallBackgroundImage = new Uri("/Assets/logo159x159.png", UriKind.Relative),
                        BackgroundImage = new Uri("/Assets/Background336x336_1.png", UriKind.Relative),
                        BackBackgroundImage = new Uri("/Assets/Background336x336_2.png", UriKind.Relative)
                    };
 
 
#if ALTERNATIVE_SOLUTION
                var mytile = Mangopollo.Tiles.TilesCreator.CreateFlipTile("wide flip tile", "created by", "Rudy Huyn", 9, new Uri("/Assets/logo159x159.png", UriKind.Relative), new Uri("/Assets/Background336x336_1.png", UriKind.Relative), new Uri("/Assets/Background336x336_2.png", UriKind.Relative));
#endif
                ShellTileExt.Create(new Uri("/MainPage.xaml?msg=from%20flip%20tile", UriKind.Relative), mytile, false);
            }
            catch
            {
                MessageBox.Show("remove tile before create it again");
            }
        }
 
        private void CreateFlipTileWide_Click(object sender, RoutedEventArgs e)
        {
            if (!Utils.CanUseLiveTiles)
            {
                MessageBox.Show("This feature needs Windows Phone 8");
                return;
            }
 
            try
            {
                var mytile = new FlipTileData
                    {
                        Title = "wide flip tile",
                        BackTitle = "created by",
                        BackContent = "Rudy Huyn",
                        Count = 9,
                        SmallBackgroundImage = new Uri("/Assets/logo159x159.png", UriKind.Relative),
                        BackgroundImage = new Uri("/Assets/Background336x336_1.png", UriKind.Relative),
                        BackBackgroundImage = new Uri("/Assets/Background336x336_2.png", UriKind.Relative),
                        WideBackContent = "This is a very long long text to demonstrate the back content of a wide flip tile",
                        WideBackgroundImage = new Uri("/Assets/Background691x336_1.png", UriKind.Relative),
                        WideBackBackgroundImage = new Uri("/Assets/Background691x336_2.png", UriKind.Relative)
                    };
 
#if ALTERNATIVE_SOLUTION
                var mytile = Mangopollo.Tiles.TilesCreator.CreateFlipTile("flip tile", "created by", "Rudy Huyn", "This is a very long long text to demonstrate the back content of a wide flip tile", 9, new Uri("/Assets/logo159x159.png", UriKind.Relative), new Uri("/Assets/Background336x336_1.png", UriKind.Relative), new Uri("/Assets/Background336x336_2.png", UriKind.Relative), new Uri("/Assets/Background691x336_1.png", UriKind.Relative), new Uri("/Assets/Background691x336_2.png", UriKind.Relative));
#endif
                ShellTileExt.Create(new Uri("/MainPage.xaml?msg=from%20wipe%20flip%20tile", UriKind.Relative), mytile, true);
            }
            catch
            {
                MessageBox.Show("remove tile before create it again");
            }
        }

 

效果:

image

 

更新主Tile:

        private void UpdateMainTile_Click(object sender, RoutedEventArgs e)
        {
            if (!Utils.CanUseLiveTiles)
            {
                MessageBox.Show("This feature needs Windows Phone 8");
                return;
            }
 
            var maintile = new FlipTileData
                {
                    Title = "main tile",
                    BackTitle = "this is",
                    BackContent = "main tile",
                    Count = 3,
                    SmallBackgroundImage = new Uri("/Assets/logo159x159.png", UriKind.Relative),
                    BackgroundImage = new Uri("/Assets/Background336x336_2.png", UriKind.Relative),
                    BackBackgroundImage = new Uri("/Assets/Background336x336_1.png", UriKind.Relative),
                    WideBackContent = "This is a very long long text to demonstrate the back content of a wide flip tile",
                    WideBackgroundImage = new Uri("/Assets/Background691x336_2.png", UriKind.Relative),
                    WideBackBackgroundImage = new Uri("/Assets/Background691x336_1.png", UriKind.Relative)
                };
 
#if ALTERNATIVE_SOLUTION
            var maintile = Mangopollo.Tiles.TilesCreator.CreateFlipTile("main tile", "This is", "main tile", "This is a very long long text to demonstrate the back content of a wide flip tile", 9, new Uri("/Assets/logo159x159.png", UriKind.Relative), new Uri("/Assets/Background336x336_1.png", UriKind.Relative), new Uri("/Assets/Background336x336_2.png", UriKind.Relative), new Uri("/Assets/Background691x336_1.png", UriKind.Relative), new Uri("/Assets/Background691x336_2.png", UriKind.Relative));
#endif
            ShellTile.ActiveTiles.First().Update(maintile);
        }

 

效果:

imageimage

 

 

 

 <script type="text/javascript"> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
智慧校园建设方案旨在通过融合先进技术,如物联网、大数据、人工智能等,实现校园的智能化管理与服务。政策的推动和技术的成熟为智慧校园的发展提供了基础。该方案强调了数据的重要性,提出通过数据的整合、开放和共享,构建产学研资用联动的服务体系,以促进校园的精细化治理。 智慧校园的核心建设任务包括数据标准体系和应用标准体系的建设,以及信息化安全与等级保护的实施。方案提出了一站式服务大厅和移动校园的概念,通过整合校内外资源,实现资源共享平台和产教融合就业平台的建设。此外,校园大脑的构建是实现智慧校园的关键,它涉及到数据中心化、数据资产化和数据业务化,以数据驱动业务自动化和智能化。 技术应用方面,方案提出了物联网平台、5G网络、人工智能平台等新技术的融合应用,以打造多场景融合的智慧校园大脑。这包括智慧教室、智慧实验室、智慧图书馆、智慧党建等多领域的智能化应用,旨在提升教学、科研、管理和服务的效率和质量。 在实施层面,智慧校园建设需要统筹规划和分步实施,确保项目的可行性和有效性。方案提出了主题梳理、场景梳理和数据梳理的方法,以及现有技术支持和项目分级的考虑,以指导智慧校园的建设。 最后,智慧校园建设的成功依赖于开放、协同和融合的组织建设。通过战略咨询、分步实施、生态建设和短板补充,可以构建符合学校特色的生态链,实现智慧校园的长远发展。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值