Windows Phone Toast通知

时间:2014-06-18 13:24:46   收藏:0   阅读:368
try
            {
                string msg = this.richTextBox1.Text;
                string title = "新通知";
                string toastMessage = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                    "<wp:Notification xmlns:wp=\"WPNotification\">" +
                       "<wp:Toast>" +
                            "<wp:Text1>" + title + "</wp:Text1>" +
                            "<wp:Text2>" + this.textBox1.Text + "</wp:Text2>" +
                            "<wp:Param>/Views/MainPage.xaml?NavigatedFrom=ToastNotification" + Uri.EscapeDataString("&title=" + title + "&msg=" + msg) + "</wp:Param>" +
                       "</wp:Toast> " +
                    "</wp:Notification>";
                byte[] strBytes = new UTF8Encoding().GetBytes(toastMessage);

                MsgLabel.Text = "发送中。。。";
                SendToastNotification(strBytes);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

 

Windows Phone Toast通知,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!