I have a class derived from window to show message to user. The problem is in some places in my application it is throwing an exception saying
The calling thread must be STA, because many UI components require this.
I came to know i need to introduce the Dispatcher to invoke the messagebox to get rid of the error. Since the messagebox is used in numerous locations the fastest fix i can think about is to override the show and showwindow and create and display the message box from there.
Please tell me how can i override the Show and ShowWindow events of a wpf window