Metro Tile Notification
来源:互联网 发布:最好用的c语言编译器 编辑:程序博客网 时间:2024/06/05 04:14
Metro Show Notification(Text&Image), use the notification queue to cycle update the tile:
protected override void OnNavigatedTo(NavigationEventArgs e) { /* //Cycle Update the Text ShowTextNotification("One", "One"); ShowTextNotification("Two", "Two"); ShowTextNotification("Three", "Three"); Windows.UI.Notifications.TileUpdateManager.CreateTileUpdaterForApplication().EnableNotificationQueue(true); */ ShowWideImageNotification("ms-appx:///Images/Metro.jpg", "one"); ShowWideImageNotification("ms-appx:///Images/redWide.png", "two"); ShowWideImageNotification("ms-appx:///Images/redWide2.png", "three"); Windows.UI.Notifications.TileUpdateManager.CreateTileUpdaterForApplication().EnableNotificationQueue(true); } public void ShowWideImageNotification(string image, string tag) { var tileXml = Windows.UI.Notifications.TileUpdateManager.GetTemplateContent(Windows.UI.Notifications.TileTemplateType.TileWideImage); var tileAttr = tileXml.GetElementsByTagName("image"); XmlElement ele = tileAttr[0] as XmlElement; ele.SetAttribute("src", image); var tileNotification = new Windows.UI.Notifications.TileNotification(tileXml); if (tag != null) { tileNotification.Tag = tag; } Windows.UI.Notifications.TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification); } public void ShowTextNotification(string text, string tag = null) { var tileXml = Windows.UI.Notifications.TileUpdateManager.GetTemplateContent(Windows.UI.Notifications.TileTemplateType.TileSquareText03); var tileAttr = tileXml.GetElementsByTagName("text"); tileAttr[0].AppendChild(tileXml.CreateTextNode(text)); var tileNotification = new Windows.UI.Notifications.TileNotification(tileXml); if (tag != null) { tileNotification.Tag = tag; } Windows.UI.Notifications.TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification); } void UpdateBadgeWithNumber(int number) { var badgeXml = Windows.UI.Notifications.BadgeUpdateManager.GetTemplateContent(Windows.UI.Notifications.BadgeTemplateType.BadgeNumber); var badgeAttr = badgeXml.SelectSingleNode("badge"); (badgeAttr as XmlElement).SetAttribute("value", number.ToString()); BadgeNotification badgeContent = new BadgeNotification(badgeXml); // send the notification to the app's application tile BadgeUpdateManager.CreateBadgeUpdaterForApplication().Update(badgeContent); }
- Metro Tile Notification
- 在Metro App中显示Toast notification
- 一起学Windows Phone7开发(十二.一 Tile Notification)
- 一起学Windows Phone7开发(十一.一 Tile Notification)
- 一起学Windows Phone7开发(十一.一 Tile Notification)
- tile
- tile
- Win8 Metro应用开发:如何使用Push notification来更新你的Metro style app
- Metro
- Metro
- Metro
- 教程:适应于Windows Phone 7的动态区块推送通知(Tile Push Notification)
- Notification
- Notification
- Notification
- Notification
- notification
- Notification
- Android如何找到正确的ALSA底层kcontrol接口?
- php中cookie和session的区别和使用方法
- <zz>matlab程序与C/C++代码混合编程
- xcode4.3.2开发iOS应用之HelloWorld
- oracle 重复数据的排查和删除
- Metro Tile Notification
- git在push的时候出现insufficient permission for adding an object错误
- mfc基于对话框程序
- 多源在线与离线数据读取一(超图切片读法)
- 变通实现select控件灰掉却能提交
- linux qt 动态链接库 静态链接库 学习笔记
- 菜鸟和大家讨论j2ee开发
- 用.Net打造一个移动客户端(Android/IOS)的服务端框架NHM(四)——Android端Http访问类
- 用Apache快速架设Django应用