private void RunExport4() { HTuple WindowID = hWindowControlWPF1.HalconID; HDevExp.RunCAM4(WindowID); this.Dispatcher.Invoke(new Action(() => { labelStatus.Content = "Finished."; buttonCAM1.IsEnabled = true; })); }