We have a VB6 application we are migrating to .NET. I'm calling to .NET functions from VB6 that open up a WPF window. We often need these windows to be running on the main thread so it behaves just like another VB6 Form. We also need to run async operations from these new windows so that requires a Dispatcher and SynchronizationContext. We simply spin up a new Dispatcher and DispatcherSynchronizationContext when we first create the service that calls our WPF windows.

On one occasion, I opened a WPF window and it didn't draw its border. **Is there some possibility of threading issues I'm not aware of with the above approach? Does this seem the right way to go about this?** I'm scared there are race conditions or hidden issues to this approach since we are managing the dispatcher ourselves unlike a typical .net Application.

I know there is Interop Forms Toolkit but we don't need vb6 code to interact directly with the form so that seems like overkill and cumbersome. We're just starting to write these windows and this interface so it'd be great to know if my approach is wrong sooner rather than later.