Skip to content

Instantly share code, notes, and snippets.

@sandorfr
Created November 26, 2012 00:01
Show Gist options
  • Save sandorfr/4145941 to your computer and use it in GitHub Desktop.
Save sandorfr/4145941 to your computer and use it in GitHub Desktop.
await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(new CoreDispatcherPriority(), action);
Window.Current.Dispatcher.RunAsync(priority, action)
static CoreDispatcher dispatcher;
public static CoreDispatcher Dispatcher
{
get { return App.dispatcher; }
}
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
Frame rootFrame = Window.Current.Content as Frame;
// [.... initialization code]
dispatcher = Window.Current.Dispatcher;
// Ensure the current window is active
Window.Current.Activate();
}
System.Windows.Deployment.Current.Dispatcher.BeginInvoke(action);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment