Unfortunately, provided code doesn't work. I tried it several times but all in vain. I tried to modified my application and show two wpf windows simultaneously after starting the application. In this case, GetWindow works perfectly and in manager two windows are tracked. I can't understand the source of issue.
The code is just simple in test application. After clicking on the button, new window is displayed:
About about =
When I added this code to the MainWindow() constructor of the first window, everything works fine.
I look forward to hearing from you. Thank you in advance.