I am using DevExpress DockManager. When I undock a window containing a MapView, my application deadlocks. The attached image shows the deadlocked threads. The reason for the deadlock is because on the Main Thread, HostedSurfaceElement.CreateHostedElementOnWorkerThread starts a thread to call HostedSurfaceElement.SurfaceBackgroundUiWorker and then calls this._backgroundUiCreatedEvent.WaitOne() to wait for the SurfaceBackgroundUiWorker method to complete. However, the method sets the RootVisual which ultimately causes ResourceDictionary.GetValue to be called, causing the deadlock.
Is there a way around this?