private void Progess_Updated(object sender, EventArgs e)
{
HandlePause();
Dispatcher.Invoke(DispatcherPriority.Background, new Action(() =>
{
if (currentProgress.IsCompleted)
{
currentProgress.Updated -= Progess_Updated;
StatusPanel.Visibility = Visibility.Visible;
StatusProgressBar.Visibility = Visibility.Visible;
StatusProgressBar.Value = currentProgress.Total;
StatusProgressBar.Maximum = currentProgress.Total;
StatusLabel.Content = currentProgress.Title;
StatusText.Text = string.Empty;
}
else
{
StatusPanel.Visibility = Visibility.Visible;
StatusProgressBar.Visibility = Visibility.Visible;
StatusProgressBar.Value = currentProgress.Current;
StatusProgressBar.Maximum = currentProgress.Total;
StatusLabel.Content = currentProgress.Title;
StatusText.Text = currentProgress.Text;
}
}));
}