I want to assign a new thread to a continuous Progress-bar in WPF application, so that it will run continuously after clicking on UI button till I receive the service response.
I did a code like below, but progress-bar (MclarenServerCecksProgressBar) it seems not working at all
MclarenServerCecksProgressBar.Visibility = Visibility.Visible;
var uiThread = new Thread(() =>
{
progressBarDisptacher = MclarenServerCecksProgressBar.Dispatcher;
// allowing the main UI thread to proceed
System.Windows.Threading.Dispatcher.Run();
});
uiThread.SetApartmentState(ApartmentState.STA);
uiThread.IsBackground = true;
uiThread.Start();
string[] servicesss = getServices(servername,server);
DataTable dtd = esd.getListOfServices(servername, usrid.Text.ToString(),
userpass.Password.ToString(), servicesss);
MclarenServerCecksProgressBar.Visibility = Visibility.Hidden;
Please arrange to suggest me to achieve this, any other pointers will be much helpful.