Thanks for the post. It helped me a great deal. I had to do little modification to work for me. If i dont mark it as background activity, until the thread is returned to original thread, it will not update. for example, in this case i had to update the text in background several times while i am making progress..
==== In the mainWindow.xaml.cs ====== set { Dispatcher.Invoke(DispatcherPriority.Background, new Action(() => { status_lable.Content = value; })); }
==== from my SignIn.cs ====== MainWindow.main.Status = "Irantha has signed in successfully-1"; Thread.sleep(2000);
MainWindow.main.Status = "Irantha has signed in successfully-2"; Thread.sleep(2000);
MainWindow.main.Status = "Irantha has signed in successfully-3"; Thread.sleep(2000);
MainWindow.main.Status = "Irantha has signed in successfully-4"; Thread.sleep(2000);
Thanks for the post. It helped me a great deal. I had to do little modification to work for me. If i dont mark it as background activity, until the thread is returned to original thread, it will not update. for example, in this case i had to update the text in background several times while i am making progress..
ReplyDelete==== In the mainWindow.xaml.cs ======
set { Dispatcher.Invoke(DispatcherPriority.Background, new Action(() => { status_lable.Content = value; })); }
==== from my SignIn.cs ======
MainWindow.main.Status = "Irantha has signed in successfully-1";
Thread.sleep(2000);
MainWindow.main.Status = "Irantha has signed in successfully-2";
Thread.sleep(2000);
MainWindow.main.Status = "Irantha has signed in successfully-3";
Thread.sleep(2000);
MainWindow.main.Status = "Irantha has signed in successfully-4";
Thread.sleep(2000);
This just literary saved my day.
ReplyDeleteThank you, thank you, and thank you!
Thanks a lot Sir ji....
ReplyDeleteworks great!
ReplyDeleteIt is fantastic: I even cannot understand Your code, however, it works for me fine. Thank you very much!!
ReplyDeleteHey , if there is a continuous update from a different async thread then sometimes it is not working as expected , please suggest some other method
ReplyDeleteNice :-)
ReplyDelete