西西软件下载最安全的下载网站、值得信赖的软件下载站!

首页编程开发其它知识 → WindowsPhone 7.8Tiles利器mangopollo

WindowsPhone 7.8Tiles利器mangopollo

相关软件相关文章发表评论 来源:西西整理时间:2013/2/10 22:48:36字体大小:A-A+

作者:西西点击:0次评论:0次标签: wp7

115网盘 WP7版V1.0.4 越狱版
  • 类型:WM|WP7平台大小:1KB语言:中文 评分:5.0
  • 标签:
立即下载

利用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 {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() { 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 {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() { 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");
            }
        }
 
效果:

创建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");
            }
        }

效果:

创建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");
            }
        }

效果:

更新主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);
        }

效果:

详细可以参见codeplex上的mangopollo的说明:http://www.cnblogs.com/sun8134/

    网盘
    (268)网盘
    网盘是什么网盘是一个云存储工具,通俗的来说就是你把文件通过网盘储存在网络上。只要你登上网,不论在什么地方都能使用。相当于网络移动盘。用起来挺方便。网盘哪个好其实这个毋庸置疑的百度云网盘是最好的,目前网盘也就那么几家,对用户来说只要免费就行了,其他的对我们的普通用户来说并不是特别重要。网盘下载客户端大全说明西西软件园提供市面上主流网盘的客户端下载,除了网盘客户端的各种版本之外,西西还会提供一些网盘相...更多>>

    相关评论

    阅读本文后您有什么感想? 已有人给出评价!

    • 8 喜欢喜欢
    • 3 顶
    • 1 难过难过
    • 5 囧
    • 3 围观围观
    • 2 无聊无聊

    热门评论

    最新评论

    发表评论 查看所有评论(0)

    昵称:
    表情: 高兴 可 汗 我不要 害羞 好 下下下 送花 屎 亲亲
    字数: 0/500 (您的评论需要经过审核才能显示)
    推荐文章

    没有数据