The problem is that the UI thread is blocked while your processing is running. You can move the processing in a background thread. Example (C#):
public Window1() {
private bool processingRunning = false;
private void button1_Click(object sender, RoutedEventArgs e) {
if (!processingRunning) { // avoid starting twice
var bw = new BackgroundWorker();
bw.DoWork += (s, args) => {
// do your processing here -- this will happen in a separate thread
...
};
bw.RunWorkerCompleted += (s, args) => {
processingRunning = false;
if (args.Error != null) // if an exception occurred during DoWork,
MessageBox.Show(args.Error.ToString()); // do your error handling here
};
bw.RunWorkerAsync(); // starts the background worker
}
}
}