I wrote a class library (.dll) that implement an interface which get called from external application via reflection the .dll has reference for another wpf application (within the same solution, different assembly) The external application call for methods from the dll that should upload the wpf application (upload a window) , I success to do so, but I am facing some issues like: 1) From the Dll Im trying to add value to the WindowViewModel and I got error which says I need to work on the Dispatcher thread, I tried to do this but it still doesnt work. 2) It say that I need to work on the STAThread, How could I do it if the external application use the dll.
I though to manage the wpf application from the dll with the App.cs instance, when I am trying to create App.cs instance on method: App.Run() Im getting error about the STAThread. any solutions?