private void SaveFtpAssetsClick(object sender, RoutedEventArgs e) { var bw = new BackgroundWorker(); bw.DoWork += (o, args) => { Dispatcher.InvokeIfRequired(() => _buffer = _boxart.GetData(), DispatcherPriority.Normal); ProcessAsset(Task.SetBoxart, false); while (_isBusy) { Thread.Sleep(100); } if (_isError) { return; } Dispatcher.InvokeIfRequired(() => _buffer = _background.GetData(), DispatcherPriority.Normal); ProcessAsset(Task.SetBackground, false); while (_isBusy) { Thread.Sleep(100); } if (_isError) { return; } Dispatcher.InvokeIfRequired(() => _buffer = _iconBanner.GetData(), DispatcherPriority.Normal); ProcessAsset(Task.SetIconBanner, false); while (_isBusy) { Thread.Sleep(100); } if (_isError) { return; } Dispatcher.InvokeIfRequired(() => _buffer = _screenshots.GetData(), DispatcherPriority.Normal); ProcessAsset(Task.SetScreenshots); }; bw.RunWorkerCompleted += (o, args) => _main.BusyIndicator.Visibility = Visibility.Collapsed; _main.BusyIndicator.Visibility = Visibility.Visible; bw.RunWorkerAsync(); }