我有一個BackgroundWorker的調用函數在BackgroundWorker的_DoWork做一個長期的過程,當發生功能錯誤,我會提示一個定製的消息框:BackgroundWorker的線程必須STA
WPFMessageBoxResult result = WPFMessageBox.Show("Activation Fail", "Error!!", WPFMessageBoxButtons.OK, WPFMessageBoxImage.Error);
例外下面發生在WPFMessageBoxResult類別:
The calling thread must be STA, because many UI components require this.
謝謝。