与众不同 windows phone (36) - 8.0 新的瓷贴: FlipTile, CycleTile, IconicTile
[源码下载]
作者:webabcd
介绍
与众不同 windows phone 8.0 之 新的瓷贴
- FlipTileData - 翻转瓷贴。继承了 wp7 时代的 StandardTileData
- CycleTileData - 循环瓷贴
- IconicTileData - 图标瓷贴
示例
1、演示 FlipTileData 的应用
Tile/FlipTile.xaml
<phone:PhoneApplicationPagex:Class="Demo.Tile.FlipTile"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"FontFamily="{StaticResource PhoneFontFamilyNormal}"FontSize="{StaticResource PhoneFontSizeNormal}"Foreground="{StaticResource PhoneForegroundBrush}"SupportedOrientations="Portrait" Orientation="Portrait"mc:Ignorable="d"shell:SystemTray.IsVisible="True"><Grid x:Name="LayoutRoot" Background="Transparent"><ScrollViewer><StackPanel><Button Name="btnPin" Content="pin the flip tile" Margin="0 0 0 10" Click="btnPin_Click" /><Image Source="/Tile/FlipTile1.png" /><Image Source="/Tile/FlipTile2.png" /><Image Source="/Tile/FlipTile3.png" /></StackPanel></ScrollViewer></Grid></phone:PhoneApplicationPage>
Tile/FlipTile.xaml.cs
/** FlipTileData - 翻转瓷贴。继承了 wp7 时代的 StandardTileData* Title - 正面标题* SmallBackgroundImage - 小图块正面背景* BackgroundImage - 中图块正面背景* WideBackgroundImage - 宽图块正面背景* Count - 正面显示的 badge (徽章),范围 1 - 99* BackTitle - 背面标题* BackBackgroundImage - 中图块背面背景* WideBackBackgroundImage - 宽图块背面背景* BackContent - 中图块背面内容* WideBackContent - 宽图块背面内容* * 小图块大小:159 × 159* 中图块大小:336 × 336* 宽图块大小:691 × 336* * 另:application icon 的大小是 100 × 100* * 关于 Tile 的更多内容参见:* http://www.cnblogs.com/webabcd/archive/2012/06/27/2564975.html* http://www.cnblogs.com/webabcd/archive/2012/07/05/2577190.html*/using System; using System.Windows; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell;namespace Demo.Tile {public partial class FlipTile : PhoneApplicationPage{public FlipTile(){InitializeComponent();}private void btnPin_Click(object sender, RoutedEventArgs e){FlipTileData flipTile = new FlipTileData(){Title = "title",BackTitle = "backTitle",BackContent = "backContent",WideBackContent = "wideBackContent",Count = 10,SmallBackgroundImage = new Uri("/Assets/AppTile.png", UriKind.Relative),BackgroundImage = new Uri("/Assets/AppTile.png", UriKind.Relative),WideBackgroundImage = new Uri("/Assets/AppTile.png", UriKind.Relative),BackBackgroundImage = new Uri("/Assets/AppTile.png", UriKind.Relative),WideBackBackgroundImage = new Uri("/Assets/AppTile.png", UriKind.Relative),};// 最后一个参数为是否支持宽图块ShellTile.Create(new Uri("/MainPage.xaml", UriKind.Relative), flipTile, true);}} }/* 通过 xml 方式构造 flip tile 数据 <?xml version="1.0" encoding="utf-8"?> <wp:Notification xmlns:wp="WPNotification" Version="2.0"><wp:Tile Id="[Tile ID]" Template="FlipTile"><wp:SmallBackgroundImage [Action="Clear"]>[small Tile size URI]</wp:SmallBackgroundImage><wp:WideBackgroundImage Action="Clear">[front of wide Tile size URI]</wp:WideBackgroundImage><wp:WideBackBackgroundImage Action="Clear">[back of wide Tile size URI]</wp:WideBackBackgroundImage><wp:WideBackContent Action="Clear">[back of wide Tile size content]</wp:WideBackContent><wp:BackgroundImage Action="Clear">[front of medium Tile size URI]</wp:BackgroundImage><wp:Count Action="Clear">[count]</wp:Count><wp:Title Action="Clear">[title]</wp:Title><wp:BackBackgroundImage Action="Clear">[back of medium Tile size URI]</wp:BackBackgroundImage><wp:BackTitle Action="Clear">[back of Tile title]</wp:BackTitle><wp:BackContent Action="Clear">[back of medium Tile size content]</wp:BackContent></wp:Tile> </wp:Notification> */
2、演示 CycleTile 的应用
Tile/CycleTile.xaml
<phone:PhoneApplicationPagex:Class="Demo.Tile.CycleTile"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"FontFamily="{StaticResource PhoneFontFamilyNormal}"FontSize="{StaticResource PhoneFontSizeNormal}"Foreground="{StaticResource PhoneForegroundBrush}"SupportedOrientations="Portrait" Orientation="Portrait"mc:Ignorable="d"shell:SystemTray.IsVisible="True"><Grid x:Name="LayoutRoot" Background="Transparent"><ScrollViewer><StackPanel><Button Name="btnPin" Content="pin the cycle tile" Margin="0 0 0 10" Click="btnPin_Click" /><Image Source="/Tile/CycleTile1.png" /><Image Source="/Tile/CycleTile2.png" /><Image Source="/Tile/CycleTile3.png" /></StackPanel></ScrollViewer></Grid></phone:PhoneApplicationPage>
Tile/CycleTile.xaml.cs
/** CycleTileData - 循环瓷贴* Title - 标题* smallBackgroundImage - 小图块背景* Count - badge (徽章),范围 1 - 99* CycleImages - 中图块和宽图块所循环显示的背景图片的集合(最多 9 张图片)* * 小图块大小:159 × 159* 中图块大小:336 × 336* 宽图块大小:691 × 336* * 另:application icon 的大小是 100 × 100* * 关于 Tile 的更多内容参见:* http://www.cnblogs.com/webabcd/archive/2012/06/27/2564975.html* http://www.cnblogs.com/webabcd/archive/2012/07/05/2577190.html*/using System; using System.Windows; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell;namespace Demo.Tile {public partial class CycleTile : PhoneApplicationPage{public CycleTile(){InitializeComponent();}private void btnPin_Click(object sender, RoutedEventArgs e){CycleTileData cycleTile = new CycleTileData(){Title = "title",Count = 20,SmallBackgroundImage = new Uri("/Assets/AppTile.png", UriKind.Relative),CycleImages = new Uri[]{new Uri("/Assets/AppTile.png", UriKind.Relative), new Uri("/Assets/AppTile.png", UriKind.Relative), new Uri("/Assets/AppTile.png", UriKind.Relative), new Uri("/Assets/AppTile.png", UriKind.Relative), new Uri("/Assets/AppTile.png", UriKind.Relative), new Uri("/Assets/AppTile.png", UriKind.Relative), new Uri("/Assets/AppTile.png", UriKind.Relative)}};// 最后一个参数为是否支持宽图块ShellTile.Create(new Uri("/MainPage.xaml", UriKind.Relative), cycleTile, true);}} }/* 通过 xml 方式构造 cycle tile 数据 <?xml version="1.0" encoding="utf-8"?> <wp:Notification xmlns:wp="WPNotification" Version="2.0"><wp:Tile Id="[Tile ID]" Template="CycleTile"><wp:SmallBackgroundImage [Action="Clear"]>[small Tile size URI]</wp:SmallBackgroundImage><wp:CycleImage1 Action="Clear">[photo 1 URI]</wp:CycleImage1><wp:CycleImage2 Action="Clear">[photo 2 URI]</wp:CycleImage2><wp:CycleImage3 Action="Clear">[photo 3 URI]</wp:CycleImage3><wp:CycleImage4 Action="Clear">[photo 4 URI]</wp:CycleImage4><wp:CycleImage5 Action="Clear">[photo 5 URI]</wp:CycleImage5><wp:CycleImage6 Action="Clear">[photo 6 URI]</wp:CycleImage6><wp:CycleImage7 Action="Clear">[photo 7 URI]</wp:CycleImage7><wp:CycleImage8 Action="Clear">[photo 8 URI]</wp:CycleImage8><wp:CycleImage9 Action="Clear">[photo 9 URI]</wp:CycleImage9><wp:Count Action="Clear">[count]</wp:Count><wp:Title Action="Clear">[title]</wp:Title></wp:Tile> </wp:Notification> */
3、演示 IconicTile 的应用
Tile/IconicTile.xaml
<phone:PhoneApplicationPagex:Class="Demo.Tile.IconicTile"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"FontFamily="{StaticResource PhoneFontFamilyNormal}"FontSize="{StaticResource PhoneFontSizeNormal}"Foreground="{StaticResource PhoneForegroundBrush}"SupportedOrientations="Portrait" Orientation="Portrait"mc:Ignorable="d"shell:SystemTray.IsVisible="True"><Grid x:Name="LayoutRoot" Background="Transparent"><ScrollViewer><StackPanel><Button Name="btnPin" Content="pin the iconic tile" Margin="0 0 0 10" Click="btnPin_Click" /><Image Source="/Tile/IconicTile1.png" /><Image Source="/Tile/IconicTile2.png" /><Image Source="/Tile/IconicTile3.png" /></StackPanel></ScrollViewer></Grid></phone:PhoneApplicationPage>
Tile/IconicTile.xaml.cs
/** IconicTileData - 图标瓷贴* Title - 标题* Count - badge (徽章),范围 1 - 99* SmallIconImage - 小图块和大图块的图标部分* IconImage - 中图块的图标部分* WideContent1 - 宽图块的第一行的文本* WideContent2 - 宽图块的第二行的文本* WideContent3 - 宽图块的第三行的文本* BackgroundColor - 图块的背景颜色,默认为主题色* 注:如果需要指定背景色,其 alpha 必须是 255,否则无效* * 注:对于图标来说只有白色和透明的概念,也就是说图标中的所有非透明的颜色都会被转换为白色* * 小图块和大图块的图标部分的大小:110 × 110* 中图块的图标部分的大小:202 × 202* * 另:application icon 的大小是 100 × 100* * 关于 Tile 的更多内容参见:* http://www.cnblogs.com/webabcd/archive/2012/06/27/2564975.html* http://www.cnblogs.com/webabcd/archive/2012/07/05/2577190.html*/using System; using System.Windows; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; using System.Windows.Media;namespace Demo.Tile {public partial class IconicTile : PhoneApplicationPage{public IconicTile(){InitializeComponent();}private void btnPin_Click(object sender, RoutedEventArgs e){IconicTileData iconicTile = new IconicTileData(){Title = "title",Count = 30,WideContent1 = "wideContent1",WideContent2 = "wideContent2",WideContent3 = "wideContent3",SmallIconImage = new Uri("/Assets/AppTile.png", UriKind.Relative),IconImage = new Uri("/Assets/AppTile.png", UriKind.Relative),BackgroundColor = new Color { A = 255, R = 0, G = 128, B = 255 } // alpha 必须是 255,否则无效 };// 最后一个参数为是否支持宽图块ShellTile.Create(new Uri("/MainPage.xaml", UriKind.Relative), iconicTile, true);}} }/* 通过 xml 方式构造 iconic tile 数据 <?xml version="1.0" encoding="utf-8"?> <wp:Notification xmlns:wp="WPNotification" Version="2.0"><wp:Tile Id="[Tile ID]" Template="IconicTile"><wp:SmallIconImage [Action="Clear"]>[small Tile size URI]</wp:SmallIconImage><wp:IconImage Action="Clear">[medium/wide Tile size URI]</wp:IconImage><wp:WideContent1 Action="Clear">[1st row of content]</wp:WideContent1><wp:WideContent2 Action="Clear">[2nd row of content]</wp:WideContent2><wp:WideContent3 Action="Clear">[3rd row of content]</wp:WideContent3><wp:Count Action="Clear">[count]</wp:Count><wp:Title Action="Clear">[title]</wp:Title><wp:BackgroundColor Action="Clear">[hex ARGB format color]</wp:BackgroundColor></wp:Tile> </wp:Notification> */
OK
[源码下载]
与众不同 windows phone (36) - 8.0 新的瓷贴: FlipTile, CycleTile, IconicTile相关推荐
- 与众不同 windows phone (40) - 8.0 媒体: 音乐中心的新增功能, 图片中心的新增功能, 后台音乐播放的新增功能...
原文:与众不同 windows phone (40) - 8.0 媒体: 音乐中心的新增功能, 图片中心的新增功能, 后台音乐播放的新增功能 [源码下载] 与众不同 windows phone (40 ...
- 背水一战 Windows 10 (1) - C# 6.0 新特性
背水一战 Windows 10 (1) - C# 6.0 新特性 原文:背水一战 Windows 10 (1) - C# 6.0 新特性 [源码下载] 背水一战 Windows 10 (1) - C# ...
- 背水一战 Windows 10 (43) - C# 7.0 新特性
背水一战 Windows 10 (43) - C# 7.0 新特性 原文: 背水一战 Windows 10 (43) - C# 7.0 新特性 [源码下载] 背水一战 Windows 10 (43) ...
- 与众不同 windows phone (22) - Device(设备)之摄像头(硬件快门, 自动对焦, 实时修改捕获视频)...
原文:与众不同 windows phone (22) - Device(设备)之摄像头(硬件快门, 自动对焦, 实时修改捕获视频) [索引页] [源码下载] 与众不同 windows phone (2 ...
- 与众不同 windows phone (29) - Communication(通信)之与 OData 服务通信
原文:与众不同 windows phone (29) - Communication(通信)之与 OData 服务通信 [索引页] [源码下载] 与众不同 windows phone (29) - C ...
- 与众不同 windows phone (14) - Media(媒体)之音频播放器, 视频播放器, 与 Windows Phone 的音乐和视频中心集成...
原文:与众不同 windows phone (14) - Media(媒体)之音频播放器, 视频播放器, 与 Windows Phone 的音乐和视频中心集成 [索引页] [源码下载] 与众不同 wi ...
- 第十六节:语法总结(3)(C#6.0和C#7.0新语法)
一. C# 6.0 新语法 1. 自动属性初始化可以赋值 1 /// <summary> 2 /// 自动属性初始化 3 /// </summary> 4 public cla ...
- 【收藏】C# 2.03.0新特性总结
c#2.0新特性 范型 我们知道通用的数据结构可以采用object存储任何数据类型.使用object问题是: 显示的强制转带来的代码复杂性 换装箱拆箱的性能损失(为什么有性能损失?因为涉及动态内存分配 ...
- php iis mysql windows2003,Windows Server 2003 IIS6.0+PHP5(FastCGI)+MySQL5环境搭建教程 | 系统运维...
准备篇 一.环境说明: 操作系统:Windows Server 2003 SP2 32位 PHP版本:php 5.3.14 MySQL版本:MySQL5.5.25 二.相关软件下载: 1.PHP下载地 ...
最新文章
- MPB:西农郑伟-土壤水稳性团聚体微生物组样品制备方法
- GPL协议 与 LGPL协议
- flutter项目内配置代理
- 【mysql基础知识】通过Navicat控制小数点位数,以及填充0后不显示的问题
- 专门跑顺风车真的挣钱吗?
- Spring 事务 状态信息的创建、回滚、清理、提交
- Datalogic得利捷引领工业4.0时代 携SG4 FIELDBUS安全光幕亮相两大国际工业展
- ios刺客信条一直显示连接服务器,刺客信条本色iOS进不去怎么办
- 合作、竞争、猜忌……车联网江湖的“战国时代”
- 计算机ps基础考试题,2014计算机一级考试PS及基础模拟试题
- Adobe flash professional CS5的序列号
- 怎么关闭计算机安全,电脑中安全防护怎么关闭
- matlab gram-schmidt,性能 – 加权Gram-Schmidt正交化的MATLAB优化
- 浏览器缓存机制,强缓存,弱缓存
- UG NX 10 草图重新附着
- Thinkpad和ThinkBook有什么区别 哪个好详细性能配置对比
- BasicVSR_pp video2frame
- hd530黑苹果硬解_解决黑苹果HD3000核显 VGA和HDMI外接显示器无反应问题
- 为什么电磁炉加热一会就停了 电磁炉加热原理与维修技巧一点通_电磁炉电路图讲解
- https://isux.tencent.com/svg-animate.html(svg动画)
热门文章
- 极致cms1:1精仿资源哟源码
- 大河抽奖盲盒运营版 1.9.12开源版
- 公众号管理模块-DouPHP模块化企业网站管理系统v1.6
- 苹果cms V10模板 仿特视网自适应模板
- 面试:一文搞懂堆和栈的区别
- 史上最详细Vue-CLI脚手架快速创建Vue项目教程
- 七款最常用的PHP本地服务器
- memcache_engine + memcachedb = 高性能分布式内存数据库
- 点击锚点链接时页面滚动的特效(Javascript Smooth Scroll)
- css透明度的设置 (兼容所有浏览器)