2,854 questions
Without source code its impossible to provide a solution to what you have. So check out the following focusing on threading
if (!Dispatcher.CheckAccess())
{
Dispatcher.Invoke(() =>
{
progressBar.Value = int.Parse(Math.Truncate(percentage).ToString());
});
}
else
{
progressBar.Value = int.Parse(Math.Truncate(percentage).ToString());
}