c# - How to prevent parent window from going into background after child is closed? -


Therefore, I am running in a problem with many of my WPF applications where children in one window after closing the window The window (usually my main window) will go in the background, I have nothing open. After some research, I found this bug report to Microsoft: "Generally the WPF team has reviewed this issue and it will not be addressed ..."

Is anyone successful in dealing with this On your own? It makes me mad and I can not find any solution.

Edit:

I had given some suggestions in my answer to James due to the uncomfortable nature of the window due to above everything else After rejecting the suggestion, I came up with:

  ChildWindow.Closed + = Representative {ChildWindow = null; this. Most = true; System.Threading.Thread.Sleep (1000); this. Most = false; };  

Therefore, when the child's stop () increases the event, I'm sure the original window is at the top again, I sleep the thread for 1 second And make the top set false so that other windows can overlay this original window.

Reason for Stop: If I do not use a break and just this.Topmost = true after this this.Topmost = false < / Code>, then the effect is never place and the bug is still due to the time for the bug.

I'm not sure that this is the best way, but it works. Microsoft has to invest more resources in WPF.

Set the main window to:

  at the top = True  

It should help a little bit, but this issue will not be solved completely, just keep in mind that if there is any other application's settings, then at the top of the application Can end in any way. I know that it helps.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -