Windows phone 8 ShellToastNotificationReceived无法更改UI

Windows phone 8 ShellToastNotificationReceived无法更改UI,windows-phone-8,mvvm,push-notification,mpns,Windows Phone 8,Mvvm,Push Notification,Mpns,我已在我的WP 8应用程序上注册推送通知服务 当我的应用程序作为Toast通知在后台运行时,它不仅更新了MVVM,还更新了 另一方面,此应用程序的视图(UI) 当我的应用程序以Toast通知的形式在前台运行时,它只更新MVVM,无法立即更新UI,当我手动刷新页面时,它可能会更新 pushChannel.ShellToastNotificationReceived += new EventHandler<NotificationEventArgs>(PushChannel_Shell

我已在我的WP 8应用程序上注册推送通知服务

当我的应用程序作为Toast通知在后台运行时,它不仅更新了MVVM,还更新了 另一方面,此应用程序的视图(UI)

当我的应用程序以Toast通知的形式在前台运行时,它只更新MVVM,无法立即更新UI,当我手动刷新页面时,它可能会更新

 pushChannel.ShellToastNotificationReceived += new EventHandler<NotificationEventArgs>(PushChannel_ShellToastNotificationReceived);
pushChannel.ShellToastNotificationReceived+=新事件处理程序(pushChannel\u ShellToastNotificationReceived);
当Toast发生时,将触发上述事件

代码:

//
///此方法在用户单击传入toast时运行
/// 
/// 
/// 
void PushChannel_ShellToastNotificationReceived(对象发送方,NotificationEventArgs e)
{
ApplicationSetting_App=新的ApplicationSetting();
_App.Load_TaskRefresh();
}

我相信事件
ShellToastNotificationReceived
没有在UI线程上触发。因此,内部的所有内容(需要UI更改)都应该包装在调度程序中。也许你可以试试这样的东西:

Deployment.Current.Dispatcher.BeginInvoke(() => {
    ApplicationSetting _App = new ApplicationSetting();
    _App.Load_TaskRefresh();
});

这里说的是“在没有Windows Phone 8 Update 3的设备上,当目标应用程序在前台运行时,不会显示toast通知”。无论如何,toast通知会将您的注意力吸引回应用程序,当已经在前台时,应用程序帮助中不会出现自定义消息吗?

您是否在模型/视图模型中实现了INotifyPropertyChanged?是的………您可以发布更多代码吗?
Deployment.Current.Dispatcher.BeginInvoke(() => {
    ApplicationSetting _App = new ApplicationSetting();
    _App.Load_TaskRefresh();
});