1

I had an alerting application on Windows 8 phone using C# and XAML. when I received a notification whilst the app was running I was able to update the UI using this code.

   private void PushChannel_ShellToastNotificationReceived(object sender, NotificationEventArgs e)
    {
        Dispatcher.BeginInvoke(async () =>
        {
           Textboc.text = "Something";
        });
    }

However I have now moved my application to Windows 10 Universal. Dispatcher.BeginInvoke does not seem to be available. Is there an alternative to this that I can use to update the UI?

1 Answers1

1
await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(
        CoreDispatcherPriority.Normal,
        () => { // your code should be here});

Correct way to get the CoreDispatcher in a Windows Store app

Community
  • 1
  • 1
Igor Damiani
  • 1,897
  • 9
  • 12