I am a newbie to WPF and have a couple of questions about WPF and Windows Forms integration.
I have an existing Visual C# Windows Forms application. I would like to integrate it with a WPF window, that can be shown on a button click. This was not possible as WPF expects the calling thread to be a STAThread and by default WinForm assumes that the thread is an MTAThread. I tried spawning a new thread with an apartment state of STAThread for calling the WPF UI but that did not work. I tried using the Dispatcher.BeginInvoke method and Background Worker as well, but none of them resolved the issue.
1) Can we make a call to WPF window/control without marking the Main as an STAThread? If it is possible, Can anyone please point me to a proper direction? 2) If the only way to accomplish this is by making the Main Thread an STAThread, will there be any impact to the general performance/responsiveness of the application.
Thanks in advance.