Archive

Posts Tagged ‘UI thread from an Asynchronous method’

Call User Interface (UI) thread from a Asynchronous method

October 13, 2011 2 comments

using System.Window.Threading;

public static class UIThread

{

       public static Dispatcher {get; set;}

      public static void Run(Action a)

      {

             Dispatcher.BeginEnvoke(a);

      }

}

and call it inside a Asynchronous  method like,

public void AsynchronousMethod()

{

      ….

      ….

      UIThread.Run(delegate()

     {

         CustomUIMethod();

     });

}

Advertisements
%d bloggers like this: