The Release Preview of Windows 8 broke some things but fortunately there’s a quite good migration guide available which highlight most of the changes (Word document):

Migrating your Windows 8 Consumer Preview app to Windows 8 Release Preview

Unfortunately the guide seems to have missed some changes, like the removing of CoreDispatcher.Invoke and BeginInvoke –methods.

Breaking Change between Consumer Preview and Release Preview:

The following code worked in WinRT app with Consumer Preview:

dispatcher.Invoke(CoreDispatcherPriority.Normal, (s, e) => action(), dispatcher, null);

But the Invoke-method is now gone. If it’s OK that the action is executed asynchronously in UI thread (like BeginInvoke), this seems to be the way to go in Release Preview + WinRT combination:

dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => action());

But if the invoke must happen synchronously (like Invoke), async / await can be used:

await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => action());

UIDispatcher - A helper class which allows the synchronous and asynchronous execution of methods in UI thread:

Here’s a complete UIDispatcher-class which can be used to execute actions in UI thread:

using System;
using System.Threading.Tasks;
using Windows.UI.Core;
using Windows.UI.Xaml;

namespace Helpers
    public static class UIDispatcher
        private static CoreDispatcher dispatcher;

        public static void Initialize()
            dispatcher = Window.Current.Dispatcher;

        public static void BeginExecute(Action action)
            if (dispatcher.HasThreadAccess)

            else dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => action());

        public static void Execute(Action action)

        private static async Task InnerExecute(Action action)
            if (dispatcher.HasThreadAccess)

            else await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => action());


Call the Initialize-method at the application startup, for example in App.xaml.cs's OnLaunched-method:

// Place the frame in the current Window and ensure that it is active
            Window.Current.Content = rootFrame;


Without this the UIDispatcher won't work.

Invoking actions on UI thread:

After the UIDispatcher has been initialized, the Execute-method can be used to invoke actions in UI thread synchronously and BeginExecute to invoke action asynchronously:

ThreadPool.RunAsync(operation => UIDispatcher.Execute(() => this.Test.Text = "hello!"));


Here’s a good explanation by Jon Skeet about the differences of BeginInvoke and Invoke.


Comment by john

Is there a way to execute a method by it's Name on Windows RT??? Type.GetMethod() doesn't exist and i'm looking for a way to call a method by just using it's Name but i don't seem to find a way.

Comment by maillot coupe de france

maillot coupe de france...

Ahaa, its pleasant dialogue about this paragraph at this place at this web site, I have read all that, so now me also commenting here.|...

Comment by nike free run v3 4.0

nike free run v3 4.0...

“Fenced, monitored and welded into hundred-ton containers “of concrete and stainless steel is hardly “unguarded”....

Comment by boutique olympique de marseille

boutique olympique de marseille...

I drop a comment when I like a article on a site or if I have something to add to the conversation. Usually it is triggered by the passion communicated in the article I browsed. And after this post %BLOG_TITLE%. I was actually excited enough to drop a ...

Comment by acheter maillot de foot pas cher

acheter maillot de foot pas cher...

This is a topic which is near to my heart... Cheers! Exactly where are your contact details though?|...