博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
WP8.1StoreApp(WP8.1RT)---本地Toast
阅读量:4346 次
发布时间:2019-06-07

本文共 760 字,大约阅读时间需要 2 分钟。

WP7/8中的Toast是不能在前台弹出的。

WP8.1StoreApp可以利用Win8中的方式: 

private void Toast(string title,string content){    ToastTemplateType toastTemplate = ToastTemplateType.ToastText02;//WindowsPhone上只支持这一种    XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate);    XmlNodeList toastTextElements = toastXml.GetElementsByTagName("text");    toastTextElements[0].AppendChild(toastXml.CreateTextNode(title));    toastTextElements[0].AppendChild(toastXml.CreateTextNode(content));    ToastNotification toast = new ToastNotification(toastXml);    ToastNotificationManager.CreateToastNotifier().Show(toast);}

效果如下:

原文:

MSDN相关介绍:http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh868254.aspx

转载于:https://www.cnblogs.com/liubaicai/p/3672164.html

你可能感兴趣的文章
springcloud之Feign、ribbon设置超时时间和重试机制的总结
查看>>
观看杨老师(杨旭)Asp.Net Core MVC入门教程记录
查看>>
UIDynamic(物理仿真)
查看>>
Windows下安装Redis
查看>>
winform非常实用的程序退出方法!!!!!(转自博客园)
查看>>
centos安装vim
查看>>
linux工作调度(计划任务)
查看>>
NIO:与 Buffer 一起使用 Channel
查看>>
Android帧缓冲区(Frame Buffer)硬件抽象层(HAL)模块Gralloc的实现原理分析
查看>>
MFC接收ShellExecute多个参数
查看>>
volatile和synchronized的区别
查看>>
类中的静态函数和非静态函数的区别
查看>>
windows 下安装Apache
查看>>
Fedora14 mount出现错误时解决办法【亲测有效】
查看>>
ruby实现生产者和消费者
查看>>
node.js 之 http 架设
查看>>
MongoDB 备份与还原
查看>>
Oracle启动与关闭数据库实例
查看>>
Spring day01
查看>>
hihocoder-1740-替换函数
查看>>