public void OnStatusChanged(object sender, DownloadStatusEventArgs e)
{
if (!this.Dispatcher.CheckAccess()) {
this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new DownloadStatusChangedEventHandler((s, e2) => {
OnStatusChanged(s, e2);
}), sender, e);
return;
}
loader.Maximum = e.MaxProgress;
loader.Value = e.Progress;
}