• WP8.1StoreApp(WP8.1RT)---本地Toast


    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);
    }

    效果如下:

    原文:http://www.liubaicai.net/?p=306

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

  • 相关阅读:
    基本HAL库操作函数整理
    oled(iic协议)
    Uart串口中断收发
    博主回来啦
    博主的冒泡1
    AFO

    起床困难综合症
    费解的开关
    数独
  • 原文地址:https://www.cnblogs.com/liubaicai/p/3672164.html
Copyright © 2020-2023  润新知