Created
August 20, 2012 19:35
-
-
Save jonathanpeppers/3407041 to your computer and use it in GitHub Desktop.
Execute for Xactware
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
using System; | |
using System.Threading; | |
using MonoTouch.Foundation; | |
using MonoTouch.UIKit; | |
namespace XactwareExample | |
{ | |
public static class Execute | |
{ | |
public static void OnBackgroundThread(NSAction backgroundAction, NSAction uiAction) | |
{ | |
ThreadPool.QueueUserWorkItem (_ => | |
{ | |
backgroundAction(); | |
OnUIThread (uiAction); | |
}); | |
} | |
public static void OnUIThread(NSAction action) | |
{ | |
UIApplication.SharedApplication.BeginInvokeOnMainThread (action); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment