快速的問題。 我這樣做:Windows phone 7在前臺應用程序吐司通知
myChannel.ShellToastNotificationReceived += new EventHandler<NotificationEventArgs>(myChannel_ShellToastNotificationReceived);
所以,如果我收到Toast通知,而應用程序是在前臺myChannel_ShellToastNotificationReceived函數被調用。在這個功能我有:
void myChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e)
{
Dispatcher.BeginInvoke(() =>
{
ApplicationTitle.Text = "Toast Notification Message Received";
});
}
問題是,該函數永遠不會被調用,並且ApplicationTitle永遠不會改變。
我做錯了什麼?
您可以檢查您是否實際收到通知? – abhinav
如果應用程序不在前臺,則在屏幕頂部會出現Toast消息...所以我認爲如果我只是離開應用程序並指示我的服務發送一個推送它的工作。但不是當它在前臺 –