To prevent other windows overlaying your window when it is deactivated you can add the method, I'd use the solution at WPF Always On Top (I've it used before and it worked well for me), to the Deactivated
event of the window:
private void Window_Deactivated(object sender, EventArgs e)
{
Window window = (Window)sender;
window.Topmost = true;
}
If you would like to show a progress bar in a fullscreen window when your operation is in progress, you could do something like:
private Window CreateFullScreenLoadingBar()
{
Window fullscreenWindow = new YourLoadingBarWindow();
fullscreenWindow.WindowStyle = WindowStyle.None;
fullscreenWindow.WindowState = WindowState.Maximized;
fullscreenWindow.ResizeMode = ResizeMode.NoResize;
fullscreenWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
fullscreenWindow.Deactivated += delegate (object sender, EventArgs e)
{
Window window = (Window)sender;
window.Topmost = true;
};
}
Usage:
...
Window loadingBar = CreateFullScreenLoadingBar();
fullscreenWindow.Show();
fullscreenWindow.Activate();
// Your code
loadingBar.Close();
...
Where YourLoadingBarWindow
is a window containing a progress bar or whatever you want the user to see.