Created
November 26, 2012 00:01
-
-
Save sandorfr/4145941 to your computer and use it in GitHub Desktop.
Tip of Monday, Access the current dispatcher with WinRT : http://www.sandor.fr/2012/11/26/lastuce-du-lundi-acceder-au-dispatcher-dans-une-application-winrt/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(new CoreDispatcherPriority(), action); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Window.Current.Dispatcher.RunAsync(priority, action) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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