I am writing a Visual Studio extension for our Dev team (a VSIX solution). When the user activates the extension, they get a form which is a very simple WPF window. The window is loaded using the following code:
var myWindow = new SomeWpfWindow(myArgs)
Owner = Application.Current.MainWindow
The solution provided above solved the problem described above, but it wasn't the complete solution. What I found was that, having closed my WPF Dialog Window, I was then able to type into a C# window in the open Solution, but not able to Delete or back-space to remove text. Also when I tried to close Visual Studio, it gave the following warning:
Microsoft Visual Studio has detected that an operation is blocking user input. This can be caused by an active modal dialog or a task that needs to block user interaction. Would you like to shut down anyway?
Please refer to the following post for the solution to this: WPF modal window in Visual Studio Extension blocking input