WPF-Window Topmost for native application?

In Splashscreen / Loading-Window, my WPF application is set to Topmost = "True" . Now these windows are on top of all other windows, even when you switch to another application (because downloading will take some time). I do not want this behavior.

If I set the Topmost = "False" window, not the topmost one. But if you return to my application after working with another application, my clients sometimes do not realize that Loading-Windows is still working. The application seems unresponsive because the download window in the background is still the active window and it is modal.

I want the Download Window window to be closed, but only if my application is in the foreground. If you switch to another program, the window should disappear and appear at the top when you return.

+11
c # wpf window topmost
Mar 17
source share
2 answers

You can try to use the "Owner" property of the window, while the splash screen will always overlap other windows.

+9
Mar 17 '10 at 15:50
source share

I think maybe changing the loading template of your MainWindow can help. If you can spend a lot of time loading a window onto a background thread, you can use this way:

  • Show MainWindow empty or bare dice (empty margins / grid, etc.)
  • Run the async boot method to get the data and populate the main window
  • Create a screensaver, set the owner on yourself and show
  • Be sure to close the splash screen when the download is complete.

which should support a surge from above when loading a load.

+2
Feb 10 '11 at 13:50
source share



All Articles