I know that this question had been asked 100 times before, but all the answers I read didn't worked for me. So, I'll try my luck and ask again.
I have a SliderBar
that calls a method on the ValueChanged
event.
In this method I do some stuff that takes time, and I want that in this time the user will see an "working" ProgressBar
(IsIndeterminate=true
).
Unfortunately, I don't succeed to make the ProgressBar
start working (in the UI) until all the method loops finished.
I tried threads, BackgroundWorker
and async
Tasks but with no success..
What am I doing wrong?
This is the method:
private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e){
WorkingBar.IsIndeterminate = true; //change the progressBar
SqlAThread = new Thread(SqlAStart);
SqlAThread.Start();
}
The thread:
private void SqlAStart()
{
... //do some stuff
}