Popular Posts

Thursday, September 24, 2015

Thread in c#

Below is the code to use thread in c# and WPF for responsive UI.

void Main()
{
 ThreadStart ts = new ThreadStart(Test);
            Thread th = new Thread(ts);
            th.IsBackground = true;
            th.Priority = ThreadPriority.Lowest;
            th.Start();
}
void Test()
{
//TODO lengthy work
}

No comments:

Post a Comment